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


Please Help Members By Posting Answers For Below Questions

What is the function file_get_contents() useful for?

700


Write a program to find no of days between two dates in php?

732


Which is better python or php?

761


What is overloading and overriding in php?

827


When is a conditional statement ended with endif?

736


How do you identify independent and dependent variables in research?

713


Is php a low level language?

734


How does php and apache work?

776


How can image properties be retrieved in php?

749


Is rent a variable cost?

745


What is csrf cookie?

694


What is the main difference between asp net and php?

776


How stop the execution of a php scrip?

745


How to call php function in jquery?

816


What is the difference between characters 34 and x34?

722