A past programmer developed a piece of code using the PHP 4.1.1 series to use the socket_fd_* code. However, with the release of PHP 4.2, the fd code is no longer valid.
$fdr = socket_fd_alloc();
$fdz = socket_fd_alloc();
function socket_canread($sock) {
global $fdr, $fdz;
socket_fd_set($fdr, $sock);
socket_select($fdr, $fdz, $fdz, 0, 10);
$r = socket_fd_isset($fdr, $sock);
socket_fd_zero($fdr);
socket_fd_zero($fdz);
return $r;
}
Can someone help me translate the following piece to use the newer PHP 4.2 socket code?
Thanks.
-- M