RE: [PHP-WIN] Reading in text file characters
| From: | Nichols, Mark A. | Date: | Wed, 15 Jan 2003 15:41:29 +0000 |
| Subject: | RE: [PHP-WIN] Reading in text file characters | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-17887@lists.php.net to get a copy of this message | ||
I always look in the manual first. I guess I missed it.
Thanks
-----Original Message-----
From: Mikey [mailto:mikey@splatted.net]
Sent: Wednesday, January 15, 2003 10:42 AM
To: php-windows@lists.php.net
Subject: RE: [PHP-WIN] Reading in text file characters
You could try using the substr() function, it will take any number of
chars
from any place in a string. However, I think you could have found this
had
you been bothered to look in the manual first...
HTH,
Mikey
> -----Original Message-----
> From: Nichols, Mark A. [mailto:markn@spicergroup.com]
> Sent: 15 January 2003 15:17
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Reading in text file characters
>
>
> The following code reads in a text file one line at a time.
>
>
>
> for ($k=0; $k<=count($readfile)-1; $k++) {
>
> $fields = split("\t",$readfile[$k]);
>
> echo nl2br("$fields[0]<br>");
>
>
>
> }
>
>
>
> The problem is that it seems to strip the empty spaces out.
>
>
>
> My text file is formatted by lengths. I need to read the first 25
> characters from the text file. Then read 50 more... And so on.
>
>
>
> Can anyone give my the code for reading in a certain number of
> characters from a text file.
>
>
>
> Thank you in advance.
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php