php current() function


  Translation results:

UK[ˈkʌrənt] US[ˈkɜ:rənt]

adj. Current; recent; popular; circulating

n. Current; trend; current; surge

Plural: currents

php current() functionsyntax

Function: Return the value of the current element in the array.

Syntax: current(array)

Parameters:

Parameter Description
arrayRequired. Specifies the array to use.

#Description: 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.

php current() functionexample

<?php
$people = array("西门", "灭绝", "无忌");
echo current($people);
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

西门


<?php
$arr = array("peter", "灭绝", "欧阳克");
echo current($arr);
?>

Run Instance»

Click the "Run Instance" button to view the online instance

Output:

peter

Popular Recommendations

Home

Videos

Q&A