PHP的 foreach
和 java c++ 仍是有区别的
例子
foreach (array as value)
{
code to be executed;
}
{
code to be executed;
}
<
html
>
< body >
<?php
$arr=array("one", "two", "three");
foreach ($arr as $value)
{
echo "Value: " . $value . " < br />";
}
?>
</body>
</html>
< body >
<?php
$arr=array("one", "two", "three");
foreach ($arr as $value)
{
echo "Value: " . $value . " < br />";
}
?>
</body>
</html>