- Joined
- Apr 24, 2016
- Messages
- 424
- Points
- 18
I have a large data in a file .txt
How can I use PHP to read the content in this file and assign it to a variable?
How can I use PHP to read the content in this file and assign it to a variable?
This code worksHow can I use PHP to read the content in this file and assign it to a variable?
<?php
if ($fh = fopen('filename.txt', 'r')) {
while (!feof($fh)) {
$varcon= fgets($fh);
echo $varcon;
}
fclose($fh);
}
?>