Write a PHP code to print following number pattern:
123
456
789

Answer Posted / akashumate

<? php

$i=1;

while($i<=3)
{
echo $i;
$i++;
}
echo "<br>" ;
$j=$i;
while($j<=6)
{
echo $j;
$j++;
}
echo "<br>" ;

$k=$j;
while ($k<=9)
{
echo $k;
$k++;
}
echo "<br>" ;

? >

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 'float' property in css?

778


How can we access the data sent through the url with the post method?

714


How to check a key exist in an array?

787


What is isset function in php?

824


What does $_server mean?

741


What is the meaning of symbol '$' in jquery?

755


Why do we use interface in php?

715


How do you use bcrypt for hashing passwords in php?

772


Where is session id stored?

713


Is overloading possible in php?

714


why did u want to leave your past organisation?

1818


Is it possible multiple inheritance in php?

762


Explain how does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?

769


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

714


Tell me how a constant is defined in a php script?

687