Re: fscanf problem
| From: | John Vanderbeck | Date: | Mon, 12 Feb 2001 14:12:51 +0000 |
| Subject: | Re: fscanf problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39211@lists.php.net to get a copy of this message | ||
Hmm..noone has any ideas on this one? Its really driving me crazy
- John Vanderbeck
- Admin, GameDesign
----- Original Message -----
From: "John Vanderbeck" <agathorn@cfl.rr.com>
To: <php-general@lists.php.net>
Sent: Sunday, February 11, 2001 10:01 PM
Subject: [PHP] fscanf problem
> my code...
>
> WRITE TO FILE:
> if ($item_file = fopen("$thisdir/item.dat", "w"))
> {
> fwrite($item_file, "$new_item\n$asin\n$description\namazon");
> fclose($item_file);
> echo "<P CLASS=Normal>$new_item created</P>";
> }
>
> READ FROM FILE:
> $item_file = fopen("$thisdir/item.dat", "r");
> fscanf($item_file, "%s\n%s\n%s\n%s", $display, $asin, $description,
> $link);
> fclose($item_file);
>
> PROBLEM:
> $display comes out correct, but $asin, $descrition and $link are always
> empty
>
> SAMPLE FILE:
> MyItem
> 11517
> ThisIsMyDecriptionWithoutSpaces
> amazon
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>