string yp_match(string domain, string map, string key);
yp_match()Retourne la valeur associée à la clé passée en argument, pour la carte spécifiée, ou faux (FALSE). La clé doit exister.
Exemple 1. Exemple de recherche NIS <?php $entry = yp_match($domain, "passwd.byname", "joe"); if(!$entry) { echo yp_errno() . ": " . yp_err_string(); } echo "La valeur trouvée est: " . $entry; ?> |
Dans le cas présent, ce pourrait être: joe:##joe:11111:100:Joe User:/home/j/joe:/usr/local/bin/bash
Voir aussi: yp_get_default_domain yp_errno et yp_err_string