Posted by forcescript on March 16, 2009
Are you looking to buy Adobe Photoshop? If so, this article will provide useful money-saving tips on how to research the Web to discover the best possible price on expensive software like Photoshop, and save you hundreds of dollars.
Posted by forcescript on August 23, 2008
The foreach Statement
The foreach statement is used to loop through arrays.
For every loop, the value of the current array element is assigned to $value (and the array pointer is moved by one) – so on the next loop, you’ll be looking at the next element.
foreach (array as value)
{
code to be executed;
}
Example
The following example demonstrates a loop that will print the values of the given array:
<html>
<body>
<?php
$arr=array(“one”, “two”, “three”);
foreach ($arr as $value)
{
echo “Value: ” . $value . “<br />”;
}
?>
</body>
</html>
and output is
Value: one
Value: two
Value: three