[wd_asp elements=’search’ ratio=’100%’ id=1]

Foreach

7th August 2013

Php - Loops

php codehaven

Has to be used with an Array
(If there was 4 dates)

while($row = mysql_fetch_array($result))
{
$date[]= $row['date'];
}

Then as many times as there was a result of $date (in this case 4 times)

foreach ($date as $value) {
echo "hi";
}

The out put would be hihihihi