i need to read a text file n extract the text into a variable for later use for each row of text. i know this sounds like an easy tasks but i have been having trouble over it. i keep receiving 'array' instead of the actual text in my text file
example of wat my text file looks like : hello world1 hello world2 hello world3 hello world4 hello world5 hello world6 hello world7 hello world8 hello world9 hello world10
Read entire contents of a file into a scalar variable:
$variable = file_get_contents('file.txt');
Read file into an array where each array element is one line from the file:
$textArray = file('file.txt');