RE: .DAT file with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Sorry im new but, how do we read from a file to an array? I've studied C
but
not with PHP and it's not working for me... Suggestions?
[/snip]

First, read and understand, as much as possible, TFM. It should go
something like this

$foo = fopen("my.dat", "r");
while(!feof($foo)){
	$bar = fgets($foo, 4096); // gets a line hopefully
	$glorp[] = $bar; // places line in array
}

Once you have done this look at http://www.php.net/array for all of the
things that you can do with the $glorp array

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux