While and Do-While in PHP:- PHP Language Me Aapko Loops Provide Kiye Gye Hai | PHP Loops Ki Help Se Aap Ek Hi Statement ko Bar Bar Execute Karva Sakte Hai |
Jab Tak Kisi condition Ka Satisfaction Nhi Hota Hai Tab Tak Loop Ka statement repeat Hota Rahta Hai |
PHP Loops 4 Parkar Ke Hote Hai |
- While loop
- Do-while loop
- For loop
- Foreach loop
PHP While And Do-While Loop In Hindi
Contents
Flow Chart While And Do-While

While Loop in PHP in Hindi
PHP While Loop in Hindi Ek Single Loop Hoti Hai. Jab Condition True Hoti Hai Tab hi Statement Execute Hote Hai.
While Loop Ko Ham Example Ke Sath Understand Karte Hain |
Syntax While Loop :-
initial variable declaration; while(condition) { //statements //increment }
Friends Agar Me Aapse Kahu Ki MasterPrograming ko 10 bar Print Karana Hai to Aap Kiya Karenge | Mere Hisab Se Aap While Loop in Hindi Ka Hi Istemal Karenge Kyoki Aap Bar Bar Echo Likhar Print Nhi Kara Sakte Hai | Kyoki Ye Acche Programmer ki Pahchan Nhi Hoti Hai |
Example :-
<?php $number=1; while($number<=10) //while loop with condition { echo "MasterPrograming <br/>"; $number++; // incrementing operation } ?>
Output :-
Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming Masterprograming
Aap Dekh Sakte Hai While Loop ko aap kese istemal kar sakte hai.
Do-While Loop In PHP in Hindi
PHP Do While Loop In Hindi Me Pahle Program Execute Hota hai or bad me condition check Hoti Hai | Lekin Do while statement Ek bar hi execute Hoti hai.
Do While Loop Ko Ham Example Ke Sath Understand Karte Hain |
Syntax Do-While Loop
do { statements } while (expression);
Example :-
<?php $i = 0; do{ echo "Value of i is ".$i."<br />"; $i++; }while($i < 5); ?>
Output :-
Value of i is 0 Value of i is 1 Value of i is 2 Value of i is 3 Value of i is 4