Two forms of PHP for circular div label echo printing is easy to understand, how to understand the second form?

< html >
< body >

<?php
    for ($i=0;$i<10;$iPP)
    {
        echo "<div></div>";
    }
?>
<hr>

    <?php for ($i=0;$i<10;$iPP){?>
        <div></div>
    <?php }?>

< / body >
< / html >

May.16,2022

one is a php file and the other is a html file. Just write the html tag directly in the php file. Insert php content in the html file with


echo I won't talk about printing. Let's talk about the second method. The
principle is that the PHP parser will only execute the code within the tag, and everything outside the tag will be output directly.

you are bad! < / div > this code is outside the tag, so it can be output directly as a string. You can directly execute it

.

test.php


<?php for ($i=0;$i<10;$iPP)

{
   ?><div></div><?php 
}

? >
can it be understood in this way?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b4b7-2c298.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b4b7-2c298.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?