Today, We want to share with you PHP Print number Pattern Program.
In this post we will show you Number Patterns in PHP, hear for PHP for loop – Exercises, Practice, Solution we will give you demo and example for implement.
In this post, we will learn about program to print pyramid of numbers in php with an example.
PHP Print number Pattern Program
There are the Following The simple About PHP Print number Pattern Program Full Information With Example and source code.
PHP Number Pattern 1
Print number Pattern in PHP
[php]
<?php
for($a=1; $a=1; $b–)
{
echo “$b”;
}
echo “
“;
}
?>
[/php]
Output
[php]
1
21
321
4321
[/php]
Print number Pattern 2
Print number Pattern in PHP
[php]
=1; $a–)
{
for($b=1; $b<=$a; $b++)
{
echo $b;
}
echo "“;
}
?>
[/php]
Output
[php]
12345
1234
123
12
1
[/php]
Print number Pattern 3
Print number Pattern in PHP
[php]
=1; $a–)
{
for($b=5; $b>=$a; $b–)
{
echo $b;
}
echo ““;
}
?>
[/php]
Output
[php]
5
54
543
5432
54321
[/php]
Number Triangle 4
Print number Pattern in PHP
[php]
<?php
$k=1;
for($a=0;$a<4;$a++){
for($b=0;$b<=$a;$b++){
echo $k." ";
$k++;
}
echo "
“;
}
?>
[/php]
Number Triangle Output
[php]
1
2 3
4 5 6
7 8 9 10
[/php]
Number Pattern 5
Print number Pattern in PHP
[php]
<?php
$k=1;
for($a=0;$a<5;$a++){
for($b=0;$b<=$a;$b++){
if($b%2==0)
{
$k=0;
}
else
{
$k=1;
}
echo $k." ";
}
echo "
“;
}
?>
[/php]
PHP Number Triangle Output
[php]
0
0 1
0 1 0
0 1 0 1
0 1 0 1 0
[/php]
jQuery 15 Powerful Tips and Tricks for Developers and Web Designer
My Infinityknow Knowledgeable Ideas, Tips and Tricks, Useful Content, Jobs, Technology, Earn Money, gmail creation, skype, yahoo and more useful things.
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Print number Pattern Program in PHP.
I would like to have feedback on my Infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.