Print number Pattern in PHP

Advertisements

Prev Tutorial Next Tutorial

Print number Pattern Program in PHP

This is not new concept, you need to follow same concept like C programming to print number pattern in php.

Print number Pattern in PHP

<?php
 
for($a=1; $a<=5; $a++)
{
 for($b=$a; $b>=1; $b--)
{
echo "$b";
}
echo "<br>";
}

?>

Output

	
1
21
321
4321

Print number Pattern in PHP

<?php

for($a=5; $a>=1; $a--)
{
for($b=1; $b<=$a; $b++)
{
echo $b;
}
 echo "</br>";
}

?>

Output

	
12345
1234
123
12
1

Print number Pattern in PHP

<?php

for($a=5; $a>=1; $a--)
{
for($b=5; $b>=$a; $b--)
{
echo $b;
}
 echo "</br>";
}

?>

Output

	
5
54
543
5432
54321

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements