Created
February 25, 2011 08:21
-
-
Save avinash2/843519 to your computer and use it in GitHub Desktop.
Outputting values stored in an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blog = array( | |
'title' => 'My Blog', | |
'author' => 'Avinash', | |
'pages' => array('about','services','folio','contact'), | |
); | |
// Using the 'foreach' construct to output key => value pairs stored in an array | |
foreach ($blog as $property => $value) { | |
echo $property . " : " . $value . "<br />"; | |
}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment