php-general | 2001092
Date: 09/26/01
- Next message: Jason Dulberg: "RE: [PHP] select based on time/date"
- Previous message: Boget, Chris: "RE: [PHP] Variable declaration"
- Next in thread: Chris Lee: "[PHP] Re: 2D array from file"
- Reply: Chris Lee: "[PHP] Re: 2D array from file"
- Reply: Brian White: "Re: [PHP] 2D array from file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have created a 2D array, then written it into a tet file. The file is
written such that all the secondary array elements (the rows) are seperate
lines, with the "columns" tab-delimited. Now I'd like to read this file back
into a 2D array. I thought this should work:
$array_file = file ("array.dat");
for ($k=0; $k <= 63; $k++)
{
$array[$k] = explode( "\t", $array_file[$k] );
}
I know that $array[$k] is a valid variable, and that explode returns an
array, so I'm not clear why this isn't working. If I use $array = explode(
"\t", $array_file[$k] ); I get the line without any trouble. What am I
missing?
Thanks
--- John Frenzel
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jason Dulberg: "RE: [PHP] select based on time/date"
- Previous message: Boget, Chris: "RE: [PHP] Variable declaration"
- Next in thread: Chris Lee: "[PHP] Re: 2D array from file"
- Reply: Chris Lee: "[PHP] Re: 2D array from file"
- Reply: Brian White: "Re: [PHP] 2D array from file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

