Why does not display information in this cycle?
<?php error_reporting(-1); for ($tt = 1 ; $tt == 10; $tt++){ echo "{$tt}-ый раз<br>"; } echo "{$tt} op"; ?> Why does not display information in this cycle?
<?php error_reporting(-1); for ($tt = 1 ; $tt == 10; $tt++){ echo "{$tt}-ый раз<br>"; } echo "{$tt} op"; ?> You have an error in the loop, you simply equate $ tt == 10, but you probably need $ tt <10
<?php error_reporting(-1); for ($tt = 1 ; $tt < 10; $tt++){ echo "{$tt}-ый раз<br>"; } echo "{$tt} op"; ?> Your cycle condition is $tt == 10 , the cycle does not even start to run, because at the first iteration $tt = 1, not 10. Replace the condition with this $ tt <10, for example
Source: https://ru.stackoverflow.com/questions/934739/
All Articles