yp_match

yp_match -- Returns the mached line

Description

string yp_match(string domain, string map, string key);

yp_match() returns the value associated with the passed key out of the specified map or FALSE. This key must be exact.

Example 1. Example for NIS match

<?php
    $entry = yp_match($domain, "passwd.byname", "joe");

    if(!$entry) {
        echo yp_errno() . ": " . yp_err_string();
    }

    echo "Matched entry is: " . $entry;
?>
      

In this case this could be: joe:##joe:11111:100:Joe User:/home/j/joe:/usr/local/bin/bash

See also: yp_get_default_domain yp_errno and yp_err_string