Do...While Loop in PHP
It executes a block of code once without checking any conditions and then runs continuously until the condition is satisfied.
//Block of code
while( condition )
Output for the above code : 0
Explanation : We have initialised our variable $i=0. We have given the condition that $i should be greater than 5. If $i is not greater than 5, it will not continue the loop. But because this is a post tested loop, the loop will run once before checking the condition. So even though $i is not greater than 5 it entered the loop and printed "0" and then the condition does not satisfy, hence it exits the loop.
Latest PostsCreate dynamic SQL insert query in php and mysql How to Export MySQL data to excel sheet in PHP How to import excel file into mysql database in PHP How to make Registration / Signup form in php How to upload an image in PHP mysql How to make Login System with Session in PHP MySQL How to Delete data from database in php mysql How to Update Data in MySQL Database in PHP How to Fetch/Retrieve data from database in php mysql How to Insert data into database in php mysql
© Copyright - 2018 - 2022 | All rights reserved at Funda of Web IT