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 php built on?

500


Can php replace javascript?

531


Explain about PHP filter and why it should be used?

555


Explain what is the difference between $var and $$var?

527


Do while loops php?

507






What is a namespace in php?

473


What is good average session duration?

543


How to create a session? How to set a value in session?

517


What is lazy loading in php?

503


What is php.ini & .htacess file?

525


What is the major php security hole? How to avoid?

546


Is php faster than python?

557


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

513


Tell me are parent constructors called implicitly inside a class constructor?

540


Tell me is it possible to submit a form with a dedicated button?

527