多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` /** * 循环 * For * While * Do...While * Foreach */ # For 循环 # @params - init , condition , increament for ($i = 0; $i < 10; $i++) { echo $i; echo '<br>'; } # While 循环 $i = 0; while ($i < 10) { echo $i; echo '<br>'; $i++; } # Do... While $i = 0; do { echo $i; echo '<br>'; $i++; } while($i < 10); # Foreach $people = array('aa', 'bb', 'cc'); for ($i=0; $i<count($people); $i++) { echo $people[$i] . '<br>'; } foreach($people as $person) { echo $person.'<br>'; } $people = [ "aa" => "aa@gmail.com", "bb" => "bb@gmail.com", "cc" => "cc@gmail.com" ]; foreach ($people as $person => $email) { echo $person. ":" .$email; // $person: key, $email: value echo "<hr>"; } ```