Re: .DAT file with PHP

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

 



$filename = "filename.txt";
$file_content = join("\n", array_reverse(file($filename)));
echo $file_content;

Questions?

BTW I haven't tested this, so it may be completely wrong.






On 3/8/06, Paul Novitski <paul@xxxxxxxxxxxxxxxxxxx> wrote:
>
> At 07:41 AM 3/8/2006, Jabez Gan wrote:
> >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?
>
>
> file()
> Reads entire file into an array
> http://php.net/file
>
> Doesn't require open & close.
>
> Paul
>
> --
> 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