Can you convert this script to PHP for me ?

Jilll

New member
<html>
<body>
<script language="JavaScript">
for (i=1; i <= 7; i++)
{
document.write ('<font size= ');
document.write (i);
document.write (' > Hello </font> <br>');
}
</script>
</body>

i tried and did this [its wrong ]

<?php

for (i=1; i <= 7; i++)
{
print ('<font size= ');
print (i);
print "Hello" <br>

</font>
}

?>
 
variables need to start with a dollar sign ($)
also echo works the same I believe as print

<html>
<body>
<?php
for($i = 1; $i <= 7; $i++){
echo "<font size='" . $i . "'> Hello </font> <br/>";
}
?>
</body>
</html>
 
Back
Top