PHP core technology-array pointers

Source: Internet
Author: User
Tags array key reset

Operation of Array pointers:

Moves the array pointer: Next () goes down and gets the value of the current element. Prev () goes up and gets the value of the current element. End () moves to the last element unit gets the value of the last element Reset () moves to the first cell to get the value of the first element. Returns False if the move is unsuccessful.   The arguments are all arrays that need to be manipulated and are reference passes. Get information about the element that the pointer points to: the key ()//Gets the subscript current () of the element that is pointed to by the present array pointer; Gets the element that the current array pointer points to only the data is not moved the pointer also has a mixed operation: that is, you can get information about the current pointer element (the key value) or move the pointer each ();     Gets the information for the current element (information for the key and value), a. Moving pointers: We can sometimes use each of the attributes to traverse an array: We should use the loop structure to work with each.     Match condition: returns False when each to the last element.   List function: Limit of list: only function for index array. Use the list and each to complete the traversal but the array pointer is not reset after using each traversal, and needs to be reset manually.

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.