PHP Basics In Pictures
Basics
Variables
Numbers
User functions
Logic & Loops
Files
Employ looping
Print a list of elements
Create a new script with this code:
<?php
$AcmeCars = array("Ford","Dodge","Chevy");
print "<p>The text array contains:</p>";
foreach ($AcmeCars as $thisCar){
print "$thisCar<br>\n";
}
?>
Save the script as
printlist.php
in the
PHPSCRIPTS
folder.
<< BACK
NEXT >>