Results 1 to 3 of 3

Thread: first 100 characters

  1. #1

    Thread Starter
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734

    first 100 characters

    Ok I have a blob of text in a variable

    How could I print only the first 100 lines?

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    One way could be this:
    PHP Code:
    $tidbitText "";
    $fullText "";
    $text explode("\r\n",mysql_result($query,0,"blob"));
    for (
    $i=0;$i<100 || $i sizeof($text);$i++)
      
    $tidbitText .= $text[$i];

    for (
    $i=0;$i<sizeof($text);$i++)
      
    $fullText .= $text[$i];

    echo 
    $tidbitText."<br /><br />";
    echo 
    $fullText
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3

    Thread Starter
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    yah, thats what I was thinking, I just wondered if there was another/better way. o well.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width