Php array function definition and usage summary-php Tutorial

Source: Internet
Author: User
Operation of array pointer: operation of moving array pointer: Next () & amp; nbsp; down & amp; nbsp; the value of the current element is also obtained. Prev () & amp; nbsp; the value of the current element is obtained at the same time. End () & amp; nbsp; move to the last element Unit & amp; nbsp; get the value of the last element Reset () & amp; nbsp; move to the first unit & amp; obtain the value of the first element. If the operation fails, false is returned. Parameters are all arrays to be operated and are passed as references. & Amp; nbsp; get the array pointer operation: move the array pointer operation: Next () down and get the value of the current element. The value of the current element is obtained when Prev () is up. Move End () to the last element unit to get the value of the last element. move Reset () to the first unit to get the value of the first element. If the operation fails, false is returned. Parameters are all arrays to be operated and are passed as references. Obtain the information of the element pointed to by the pointer: Key (); // Obtain the element subscript Current () pointed to by the Current array pointer (); // Obtain the elements pointed to by the current array pointer. only the data is retrieved without moving the pointer. There is also a hybrid operation: you can obtain the information (key value) of the current pointer element and move the pointer at the same time. Each (); obtains information about the current element (key and value. Moving pointer: sometimes we can use the features of each to achieve

1. recommended php array pointer effects

Introduction: The array_splice () function is similar to the array_slice () function. it selects a series of elements in the array but does not return them. Instead, it deletes them and replaces them with other values.

[Related Q & A recommendations ]:

What is the difference between $ arr [0] and $ arr ['0?

Converting a php array to a string

If php_encode is used in the PHP array and JSON. parse is used to convert it into a js object, an error is returned (the previous value in the array is a json string)

PHP array conversion

How to write a PHP array formatted into a file

The above is a summary of the definitions and usage of php array functions. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.