# php数组

一、相关函数 current() 返回数组当前单元的值 reset() 将数组的内部指针指向第一个单元，并返回第一个数组单元的值 end() 将数组的内部指针指向最后一个单元并返回其值 prev() 将数组的内部指针倒回一位 next() 将数组中的内部指针向前移动一位 each() 返回数组中当前的键／值对并将数组指针向前移动一步 key() 当前指针指向元素的键名

二、数组的指针遍历

```
while ( list($key,$value) = each($fruit) ) {
    echo $key.":".$value.'<br />';
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bing.gitbook.io/phper/php/6.-chang-jian-wen-ti/php-shu-zu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
