Try this

$temp = fgets($fp,4096);
$line = substr($temp,0,10);


Robbert van Andel 


-----Original Message-----
From: Paul Reilly [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 07, 2003 9:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] substr() help


working on a peice of code that should be pretty easy, but for some reason I
am not getting any results.

I want the first 10 characters of each line from the file I am reading and
am using this code:
            $temp = str_replace("\n", "", fgets($fp, 4096));
            $line = substr ($temp, 0, 5);

when I test for temp I get 30 responses - which is correct, but when I test
for $line I get Zero responses.  Did I make a mistake in my code

Paul Reilly
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to