yp_cat is lacking in PHP5 - this is a suitable (slow, forking) replacement...
<?php
$handle = popen( 'ypcat passwd.byname', 'r' );
while (($line = fgets($handle, 1024)) !== FALSE) {
list($user,$pass,$uid,$gid,$gcos,$home,$shell) = explode (':', $line);
list($name,$room,$work,$home,$position) = explode (',', $gcos);
## Do Stuff ##
}
pclose( $handle );
?>