note 11879 added to function.yp-first.php
| From: | ohrn at chl dot chalmers dot se | Date: | Sun, 11 Mar 2001 20:11:46 +0000 |
| Subject: | note 11879 added to function.yp-first.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12271@lists.php.net to get a copy of this message | ||
The example is plain wrong. Try this instead:
<?php
$entry = yp_first($domain, "passwd.byname");
$key = $entry ["key"];
$value = $entry ["value"];
echo "First entry in this map has key " . $key . " and value " . $value;
?>
The right thing to do is to change yp_first to work as described in the manual, or change yp_next to
work the same way as yp_first actually does. Right now it's ugly to iterate using a while loop,
since the first round becomes a special case.
http://www.php.net/manual/en/function.yp-first.php