$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '127.0.0.1', 1337);
socket_recvfrom($socket, $buffer, 16, 0, $fromAddr, $fromPort);
echo "[{$fromAddr}:{$fromPort}]\t{$buffer}";
// Send a test from the command line such as:
// echo "hello" > /dev/udp/127.0.0.1/1337
PHP can actually do UDP listening and reading. This example is taken straight from the manual.