I have a script that connects to a server and send a string:
<?php
$fp = fsockopen("24.209.52.3", 6346, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GNUTELLA CONNECT/0.4\n\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
but I need it to print to the screen whatever the server sends back. How do I do this?