I am very new to php. I'd really appreciate all the help here.
I am using sftp to login to a server and get a file. I am only interested in the last line in that file. The last line seperated by tabs. I would like to store the 15, 16, 19 and 20, and 21st col values to 5 different variables. The last line looks like this:
7 1 0 59422170 306669 20188 20386 0 0 39787 59981 2014 67796 48953 2 7 90 1 1.81 11.3 12:19:50
When I issue this cCurl command the get the file, how would I read the last line in this file and parse out the certain columns in the last line?
<?php
$user="user";
$pass="pass";
$c = curl_init("sftp://$user:$pass@server1/vmstat");
curl_setopt($c, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($c);
curl_close($c);
#echo $data;
?>