18.06.2011, 12:29
PHP Code:
//Using UDP connection
//The example below shows how to retrieve the day and time from the UDP service "daytime" (port 13) in your own machine. As on PHP website.
<?php
$fp = fsockopen("udp://127.0.0.1", 13, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
} else {
echo "Connection was successful !";
}
?>