Home >> PHP >> current() function in PHP

current() function in PHP

The current() function used for returns the value of the first element in an array.

Syntax

current(array)

Example

$array = array("ram", "shyam", "ravi");

echo current($array);

Output

ram

 

Post Your Comment

Next Questions
each() function
end() function
extract() function
in_array() function
key() function
krsort() function
ksort() function
list() function
natcasesort() function
natsort() function
pos() function
prev() function
range() function
reset() function
rsort() function
shuffle() function
sizeof() function
sort() function
uasort() function
uksort() function
usort() function
What is the difference between array_combine() and array_merge()
What are the differences between array_diff(), array_diff_assoc() and array_diff_key()
What is the difference between array_intersect_assoc() and array_intersect_key()
What is difference between array_push() and array_pop()

Copyright ©2022 coderraj.com. All Rights Reserved.