Home>Article>Backend Development> Recommended php array pointer effects

Recommended php array pointer effects

巴扎黑
巴扎黑 Original
2017-06-14 15:18:37 1361browse

Operation of array pointer: Operation of moving array pointer: Next() downward and the value of the current element will be obtained at the same time. Prev() will get the value of the current element when going up. End() moves to the last element unit and gets the value of the last element. Reset() moves to the first unit and gets the value of the first element. If the move is unsuccessful, return false. The parameters are all arrays that need to be operated and are passed by reference. Get the information of the element pointed to by the pointer: Key();//Get the subscript of the element pointed to by the current array pointer Current();//Get the element pointed by the current array pointer. Only get the data without moving the pointer. There is also a mixed operation: that is You can get the information (key value) of the current pointer element and you can also move the pointer at the same time. Each(); obtains the information of the current element (key and value information), each. Moving the pointer: We can sometimes use the characteristics of each to achieve

1.php array pointer

Recommended php array pointer effects

Introduction: This article introduces php array pointers

2.php array pointer study notes (1)

Recommended php array pointer effects

Introduction:: PHP array pointer study notes (1): There is such a problem, an array queue, the array length is fixed , when inserting elements into the input, after exceeding the maximum length, the array automatically starts to overwrite and fill from the beginning. At this time, the entire array forms a ring. As shown below. // Define an array $test_array = array();function push_array($value, &$test_array) { if (count($test_array) < 12) { // When the number is

3.Detailed explanation of the usage of php array pointers

Introduction: ec(2); First give a conclusion, and then we will use code to prove this conclusion. $arrtmp=$arr; In this assignment expression, I call $arr the assignment array, and $arrtmp the assigned array. When the array is assigned, if the array pointer of the assigned array already points to the end of the array, the array pointer of the assigned array will be reset after the assignment and points to the first element of the array; if during the assignment, the array pointer of the assigned array does not point to the array. At the end, it points to any valid array element, then assign the array's

after the assignment. [Related Q&A recommendations]:

The above is the detailed content of Recommended php array pointer effects. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn