Q:

Write a PHP script to get the first element of the above array

0

$color = array(4 => 'white', 6 => 'green', 11=> 'red');
Write a PHP script to get the first element of the above array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$color = array(4 => 'white', 6 => 'green', 11=> 'red');
echo reset($color)."\n";
?>

Sample Output:

white

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now