I have a text file that is formatted like this
CINCINNATI CVG VORD 39.015981 -84.703344117.30L
ROBINSON RSV VORD 39.018097 -87.648636108.40T
I would like to put each line into an element into an array named $contents
so for example
$contents[0] would be "CINCINNATI CVG VORD 39.015981 -84.703344117.30L"
and
$contents[1] would be "ROBINSON RSV VORD 39.018097 -87.648636108.40T"
Heres where i'm at thus far:
$oldairac = "oldairac.txt";
$filehandleold = fopen($oldairac, "r");
$contents = fread($filehandleold, filesize($oldairac));
echo $contents;
Now that displays the info in the file. The problem is I get a result of:
CINCINNATI CVG VORD 39.015981 -84.703344117.30L ROBINSON RSV VORD 39.018097 -87.648636108.40T
Which displays the information but has no formatting. So here is my question. How would "froce" the script to keep the same formatting as the original file (including all spaces and etc)
Second question:
lets use the following as an example:
here is whats in the text file:
;Airac 0801
CINCINNATI CVG VORD 39.015981 -84.703344117.30L
ROBINSON RSV VORD 39.018097 -87.648636108.40T
How would I be able to "force" the script to ignore all the lines in the text file that begin with the ; and only add the other lines to the array.