Write a PHP code to print following number pattern:
123
456
789

Answer Posted / sam

<?php
$num = "";
for($i = 1; $i<=9; $i++ )
{
if($i%3 == 1)
{
echo "<br />";
}
echo $i;
}
?>

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an anti csrf token?

712


Is php procedural or oop?

775


Which Scripting Engine PHP uses?

823


Does php support multiple inheritances?

779


Are php variables global?

767


How to check curl is enabled or not in PHP

901


Is php used in 2019?

741


What is config file in php?

768


How do you call a constructor for a parent class?

688


What is $this in php?

760


What is isset in php?

752


How is it possible to know the number of rows returned in result set?

782


Which will check if a function exists?

856


What are advantages of .htaccess?

749


Can we run php in apache tomcat?

752