Current Location: Home> Function Categories> pos

pos

Alias ​​for current
Name:pos
Category:Array
Programming Language:php
One-line Description:The alias for current().

Definition and usage

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

This function is an alias for the current() function.

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.

Related methods:

  • current() - Returns the value of the current element in the array
  • 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

 pos ( array )
parameter describe
array Required. Specifies the array to be used.
Similar Functions
  • Returns the current element in the array current

    current

    Returnsthecurrentele
  • Create an array based on range, containing specified elements range

    range

    Createanarraybasedon
  • Check if there is a value in the array in_array

    in_array

    Checkifthereisavalue
  • Rewind the inner pointer of the array back to one prev

    prev

    Rewindtheinnerpointe
  • Point the inner pointer of the array to the first unit reset

    reset

    Pointtheinnerpointer
  • Move the inner pointer in the array one by one next

    next

    Movetheinnerpointeri
  • Remove a part of the array and replace it with other values array_splice

    array_splice

    Removeapartofthearra
  • Use user-defined functions to make callbacks to each element in the array array_walk

    array_walk

    Useuser-definedfunct
Popular Articles