< 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 >
< 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 >
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
test.php <?php for ($i=0;$i<10;$iPP) ? > 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.
tag, so it can be output directly as a string. You can directly execute it .
{
?><div></div><?php
}
can it be understood in this way?