Previous | Home | Next |
array_next()
The next() function moves the internal pointer to, and outputs, the next element in the array.
Syntax:next(array)
In above syntax, "array" specifies the array to use.
Example:
<?php $vehicle = array("Car", "Scooter", "Motorcycle", "Truck"); echo current($vehicle)."<br>"; echo next($vehicle); ?>
Output:
Car Scooter
array_prev()
The prev() function moves the internal pointer to, and outputs, the previous element in the array.
Syntax:prev(array)
In above syntax, "array" specifies the array to use.
Example:
<?php $vehicle = array("Car", "Scooter", "Motorcycle", "Truck"); echo current($vehicle)."<br>"; echo next($vehicle). "<br>"; echo prev($vehicle); ?>
Output:
Car Scooter Car
Previous | Home | Next |