Jump to content

php file( )


sheraz

Recommended Posts

sir i m trying to get data from a file but it is not working correctly.please tell me the solution.

 

Here is the code.

 

<?

if(!($fp=fopen("abc.txt", "r")) )

die ("cannot connect to the file");

else

{

$lines[]=file("abc.txt");

foreach($lines as $line_num=>$lines)

{

echo $line_num;

}

}

?>

 

i want the data written in file. but its output is 0.

Link to comment
https://forums.phpfreaks.com/topic/159611-php-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.