# yp_first

(PHP 4, PHP 5 < 5.1.0)

yp_first — Returns the first key-value pair from the named map

### 说明

yp_first ( string `$domain` , string `$map` ) : array

Gets the first key-value pair from the named `map` in the named `domain`.

### 参数

`domain`

  The NIS domain name.

`map`

  The NIS map.

### 返回值

Returns the first key-value pair as an array on success, or `FALSE` on errors.

### 范例

Example #1 Example for the NIS first

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

    $key = key($entry);
    $value = $entry[$key];

    echo "First entry in this map has key " . $key . " and value " . $value;
    ?>

### 参见

- yp_next() - Returns the next key-value pair in the named map
- yp_get_default_domain() - Fetches the machine's default NIS domain