Write a PHP code to print following number pattern:
123
456
789
Answer Posted / rajendra
<?php
$num = "";
for($i=1;$i<=9;$i++) {
$num .= $i;
if($i%3==0){
$num .="<br />";
}
}
echo $num;
?>
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the difference between overloading and overriding in php?
What language is similar to php?
Why use static methods php?
What does explode do in php?
In php, how to redirect from one page to another page?
How to read a file in binary mode?
Does php have multiple inheritance?
How to call javascript function in php without any event?
What is mvc php?
How do we get the current session id?
What are interfaces in php?
Tell me which function gives us the number of affected entries by a query?
Explain what is the difference between session and cookie?
What does the expression exception::__tostring means?
What is the correct php command to use to catch any error messages within the code?