I'm writing a PHP script which stores the values in the file in an array. I want newlines and spaces to be preserved.
The text file looks like below:
abc
pqr
xyz
What I thought is to use cat
Linux command to read the file and then direct it's value in an array.
This is what I tried:
$input = '/var/www/oj/1.in';
$array = system(cat $input);
That didn't work. Any ideas?