current : Array Function : Data Structure PHP Source Code


PHP Source Code » Data Structure » Array Function »

 

current




<?php
$fruits = array("apple""orange""banana");
print_r($fruits);
$fruit = current($fruits)// returns "apple"
echo "Fruit: $fruit<br />";
$fruit = next($fruits)// returns "orange"
echo "Fruit: $fruit<br />";
$fruit = prev($fruits)// returns "apple"
echo "Fruit: $fruit<br />";
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Array Function