Hey Guys,
I have a text file (new.txt) containing values "100.000 100.000 99.931 99.930 99.932 99.723" - a string of uptime stats. Im wishing to assign each of these values to an array so I can manipulate the date (add them and then devide by 6 to get a 6 month average). Im pretty sure i'll figure out the addition side of things but im struggling to get the array right.
$file = 'array(file_get_contents ('new.txt'))';
Echo "uptime is {$file['1']} <br>";
Echo "uptime is {$file['2']} <br>";
Echo "uptime is {$file['3']} <br>";
Echo $file;
?>
I imagine it's probably just a matter of getting the first line right. Im not quite sure how the " and ' and 's differ. I've used bash a bit and it doesnt seem to follow the same sorta syntax! Any corrections to the above code would be appreciated, and a link to something covering the basics of how the
, ", ' characters are interpreted would be good too.
Thanks heaps in advance
Stewart