Array in file
Moderator: General Moderators
Array in file
Hi there, how can i convert the content of a file, to an element array, i mean, each line as an element...thanks
!
you'll smack yourself after you see how easy it is ...
http://www.php.net/manual/en/function.file.php
Code: Select all
$fileArray = file($filename)http://www.php.net/manual/en/function.file.php
this would jsut print each line, but just do whatever you want with the line...
Code: Select all
$fileArray = file($filename);
foreach($fileArray as $line) {
echo $line;
}