In this article, you will learn How to Print Div in PHP using For Looping. <html> <head> <title>div's</title> <style> .ak{ heigth:150px; width:50px; border:1px solid; } </style> </head> <body> <form method="POST"> <h1 name="first"><?php for($i=0;$i<=5;$i++) { echo '<div class="ak">' .$i . '</div>'.'<br>' ; } ?></h1> <h1 name="second"><?php for($j=5;$j>=1;$j--) { echo '<div class="ak">' .$j . '</div>'.'<br>' ; } […]
In this article, you will learn Even Odd Program in PHP using For Loop <?php echo "even no. are-" ." "; for($i=1;$i<=100;$i++){ if($i%2==0){ echo '(' .$i .')' ." "; } } echo "<br>"; echo "odd no. are-" ." "; for($i=0;$i<=100;$i++){ if($i%2!=0){ echo '['.$i.']' ." "; } } ?> In the above program using two loopings. One for […]