| This article describes the PHP array to take the current array of values of the method, there is a need for a friend reference. In the operation of the PHP array, you can use the current () function to return the array value in the array where the pointer is currently located. The form is as follows: Mixed current (array array) For example, get the array value:
"Red", "banana" = "yellow"); while ($fruit = current ($fruits)) { ", $fruit); Next ($fruits); } by bbs.it-home.org//Red //Yellow ?>
The definition and usage of the current function. Define and use the current () function to return the element (cell) in the array. Each array has an internal pointer to its "current" element, which initially points to the first element inserted into the array. The current () function returns the value of the array element that is currently pointed to by the internal pointer and does not move the pointer. If the internal pointer points beyond the end of the cell list, current () returns FALSE. Syntax current (array) Parameter description array required. Specifies the array to use. Hints and Comment comments: If there are empty elements, or the element has no value, the function also returns FALSE. Tip: The function does not move the internal pointer. To do this, use the next () and Prev () functions. Example:
";//by bbs.it-home.org?>
Output Result: Peter about using current () to get the contents of the array, this is what we want to help everyone. |