Current Location: Home> Function Categories> current

current

Returns the current element in the array
Name:current
Category:Array
Programming Language:php
One-line Description:Returns the current element in the array.

Definition and usage

current() function returns the value of the current element in the array.

Each array has an internal pointer pointing to its "current" element, initially pointing to the first element inserted into the array.

Tip: This function will not move the internal pointer of the array. To do this, use next() and prev() functions.

Related methods:

  • end() - Point the inner pointer to the last element in the array and output
  • next() - Points the inner pointer to the next element in the array and outputs
  • prev() - Point the inner pointer to the previous element in the array and output
  • reset() - Points the inner pointer to the first element in the array and outputs
  • each() - Returns the key name and key value of the current element and moves the internal pointer forward

grammar

 Current ( array )
parameter describe
array Required. Specifies the array to be used.

Description

current() function returns the current element (unit) in the array.

Each array has an internal pointer pointing to its "current" element, initially pointing to the first element inserted into the array.

current() function returns the value of the array element currently pointed to by the internal pointer, and does not move the pointer. If the internal pointer points to the end of the cell list, current() returns FALSE.

Similar Functions