はじめに
php::foreachの書き方メモです。
■参考書にあるパターン
[code language="php"]
<?php
$keitai =array("docomo","softbank","au","willcom");
foreach ( $keitai as $name){
echo $name."<br />\n";
}
?>
[/code]
■endforeach を使用した書き方
[code language="php"]
<?php
$keitai =array("docomo","softbank","au","willcom");
foreach ($keitai as $name):
echo "$name<br>\n";
endforeach;
?>
[/code]
参考URL
PHP初心者のブログ