Hi,
The following code is taken from php.net, and demonstrates how to use a soccet and print the returned data.
$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
in my script, the returned data has multiple lines and I only want to display the last line of the returned data (not all as above)and load the value into a string.
Please can anyone tell me how?
Thanks
Stephen Fletcher