Loop string items in an array in PHP
Description
The following code shows how to loop string items in an array.
Example
<?php//ww w .j av a 2 s. com
$links = array("www.java2s.com","www.php.net","www.apache.org");
echo "<b>Online Resources</b>:<br />";
foreach($links as $link) {
echo "<a href=\"http://$link\">$link</a><br />";
}
?>
The code above generates the following result.