PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

yp_order> <yp_match
Last updated: Fri, 05 Sep 2008

view this page in

yp_next

(PHP 4, PHP 5 <= 5.0.5)

yp_nextマップから、次のキー/値の組を返す

説明

array yp_next ( string $domain , string $map , string $key )

map という名前のマップの中で、指定したキー key の次にある キー/値 の組を返します。

パラメータ

domain

map

key

返り値

次のキー/値 の組を表す配列、あるいはエラー時に FALSE を返します。

例1 NIS next の例

<?php
$entry 
yp_next($domain"passwd.byname""joe");

if (!
$entry) {
    echo 
"エントリがありません\n";
    echo 
"<!--" yp_errno() . ": " yp_err_string() . "-->";
}

$key key($entry);

echo 
"joe の次のエントリのキーは " $key 
      
"、値は " $entry[$key];
?>



add a note add a note User Contributed Notes
yp_next
russell dot brown at insignia dot nospam dot com
05-Jul-2001 12:45
If you combine yp_first and yp_next you can get the whole list:
function yp_list($domain, $map) {
   $entry = yp_first($domain, $map);
   $key = $entry ["key"];
   $yplist[$key] = $entry ["value"];
   
   while ($entry) {
      $entry = yp_next($domain, $map, $key);
      if ($entry) {
         $nextkey = key ($entry);
         $yplist[$nextkey] = $entry[$nextkey];
         $key = $nextkey;
      }
   }
   return $yplist;
}

yp_order> <yp_match
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites