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 difference between echo and print in php?
How to create a session? How to set a value in session?
What does addslashes do in php?
What is $_ get in php?
Which function you can use in php to open a file for reading or writing or for both?
What is the difference between substr() and strstr()?
What is the difference between == and === in php?
How to get ip address of clients machine?
What is the difference between static and dynamic websites?
How to get useful error messages in php?
What is the difference between explode and split?
How to run a php script?
What are php string functions?
How to open a file for reading?
What is the role of php?