Ok I have a blob of text in a variable
How could I print only the first 100 lines?
Printable View
Ok I have a blob of text in a variable
How could I print only the first 100 lines?
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;
yah, thats what I was thinking, I just wondered if there was another/better way. o well.
Thanks :)