Why does not display information in this cycle?

<?php error_reporting(-1); for ($tt = 1 ; $tt == 10; $tt++){ echo "{$tt}-ый раз<br>"; } echo "{$tt} op"; ?> 
  • put a semicolon at the end. What comes out is a separate conversation)) - Jean-Claude
  • Corrected, but the infa from the cycles is not displayed - Nuzo
  • because it does not pass the test $ tt == 10 - Jean-Claude

2 answers 2

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"; ?> 
  • Does not equate, but compares. - Enikeyschik

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