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
  • Point the inner pointer of the array to the first unit reset

    reset

    Pointtheinnerpointer
  • Fill a value into an array with a specified length array_pad

    array_pad

    Fillavalueintoanarra
  • Disrupt the array shuffle

    shuffle

    Disruptthearray
  • Sort arrays using the "natural sort" algorithm natsort

    natsort

    Sortarraysusingthe&q
  • Sort the array and maintain index relationships asort

    asort

    Sortthearrayandmaint
  • Sort arrays by key names ksort

    ksort

    Sortarraysbykeynames
  • Reversely sort the array and maintain index relationships arsort

    arsort

    Reverselysortthearra
  • Sort multiple arrays or multi-dimensional arrays array_multisort

    array_multisort

    Sortmultiplearraysor
Popular Articles