Easy Tutorial
❮ Func Math Srand Func Mysqli Stat ❯

PHP prev() Function

Complete PHP Array Reference Manual

Example

Outputs the value of the current element, the next element, and the previous element in the array:


Definition and Usage

The prev() function moves the internal pointer to the previous element in the array and outputs its value.

Related methods:


Syntax

Parameter Description
array Required. Specifies the array to use.

Technical Details

Return Value: Returns the value of the previous element in the array if successful, or FALSE if there are no more elements.
PHP Version: 4+
--- ---

More Examples

Example 1

Demonstration of all related methods:


❮ Func Math Srand Func Mysqli Stat ❯