ARRAY IN PHP

ARRAY IN PHP
$a=array("violet","indigo","blue","green");
echo "The first element of the array is".reset($a)."
";
echo "The next element of the array is".next($a)."
";
echo "The first element of the array is".prev($a)."
";
echo "The first element of the array is".end($a)."
";
?>

$a= array("violet","indigo","blue","green");
print_r($a);
echo "
";
array_push($a,"yellow");
print_r($a);
echo "
";
array_pop($a);
print_r($a);
echo "
";
array_unshift($a,"red");
print_r($a);
echo "
";
array_shift($a);
print_r($a);
echo "
";

?>

No comments: