Is there a quick way to ask to 'echo' or 'print' all elements of a numeric array? Can I specify to print "all of the keys" or "all of the values"? I wrote up 5 quick lines of code to print all of my values, but there has to be a built_in function I can call to do that for me right? Like function($month s) or something?
Do I use var_dump()? This would allow me to see the entire thing, but what if I only want to specify 'just keys' or 'just values'?
Code:
<?php
$months=array('January','February','March','April');
$key=0;
$calendar=count($months);
while($key<=$calendar){
echo "$months[$key]<br/>";
$key++;}
?>
Comment