Web Hosting Talk







View Full Version : help About php


BluraMI
12-11-2004, 05:46 AM
I want to input a file to an arry(memory) and then output it to the client, how shall I wirte the code. I am not a native english speaker. if possible, e-mail me. thanks.

Burhan
12-11-2004, 12:19 PM
<?php

$file_contents = file("nameoffile.txt");
foreach ($file_contents as $line_number => $line)
{
echo $line_number." : ".$line."<br />";
}
?>

http://www.php.net/file <-- read this page at php.net

BluraMI
12-13-2004, 02:33 AM
thanks a lot.