Gets the first (first element) of the arrayReset
(PHP 4, PHP 5)
Reset - Point The inner pointer of the array to the first cell
Description
Reset   (   array   & $array
  )
Reset () the array
internal pointer is inverted back to the first cell and returns the value of the first array cell.
Parameters
return value
Returns the value of the first cell of the array, or returns FALSE
If the array is empty.
Example
Example #1 Reset () Example
<?php
$array= Array (' Step One ', ' Step ', ' Step three ', ' Step four ');
By default, the pointer are on the first element
Echo Current($array) . "<br/>\n"; "Step One"
Skip Steps
Next($array);
Next($array);
Echo Current($array) . "<br/>\n"; //"Step three"
Reset pointer, start again on step one
Reset($array);
Echo Current($array) . "<br/>\n"; //"Step One"
?>
See
Current ()-Returns the cell in the array
each ()-Returns the current key/value pair in the array and moves the array pointer one step forward
Prev ()-Returns the internal pointer of the array back to a
Reset ()-Points the inner pointer of the array to the first cell
Next ()-Moves the inner pointer in the array forward one
get Last (tail element)End
(PHP 4, PHP 5)
end-the inner pointer of an array to the last cell
Description
Mixed End ( array &$array
)
End () array
moves the internal pointer to the last cell and returns its value.
Parameters
array
This array. The array is passed by reference, because it is modified by this function. This means that you must pass in a real variable, not an array returned by the function, because only the real variable can be passed by reference.
return value
Returns the value of the last element, or if an empty array is returned FALSE
.
Example
Example #1 End () example
<?php
$fruits= Array (' Apple ', ' Banana ', ' Cranberry ');
EchoEnd($fruits); Cranberry
?>
See
Current ()-Returns the cell in the array
each ()-Returns the current key/value pair in the array and moves the array pointer one step forward
Prev ()-Returns the internal pointer of the array back to a
Reset ()-Points the inner pointer of the array to the first cell
Next ()-Moves the inner pointer in the array forward one
This article from "I am a phper, simple and naïve" blog, please be sure to keep this source http://thinkforphp.blog.51cto.com/8733331/1784642
PHP-Get array kinsoku elements