$num=1;
$rows=4;
for($i=1;$i<=$rows;$i++){
for($j=1;$j<=$i;$j++){
echo $num;
$num++;
}
echo "\n";
Output
1
2 3
4 5 6
7 8 9 10
Coderraj is the global online platform and circle for programmers to learn, communicate, share their knowledge and growth their careers.
Copyright ©2022 coderraj.com. All Rights Reserved.