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

How can we destroy the cookie in php?

734


What are the advantages of php mysql?

718


What are the differences between php constants and variables?

722


What is php full form?

747


Does session expire on closing browser?

690


What is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

732


Is php difficult to learn?

687


What is php artisan serve?

690


What is php session id?

713


How to access a Static Member of a Class in PHP?

744


What is php? Why it is used?

762


Tell me what is htaccess?

671


What is php oops concepts?

702


How do I end a php session?

686


How the web server interprets php and interacts with the client?

716