Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the diffrence between for and foreach?

Answer Posted / swapnil

well when we use for loop it will execute only for the time
we have mentioned in loop ie ex for(i=0;i<25;i++) 25 times
whereas foreach is used only when we dont know that limit it
may be the case when we perform operation on database queries

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define anonymous classes in php7?

978


Explain the advantages of using PHP?

958


What is mysql in php?

886


Write a program to get lcm of two numbers using php?

911


What is the basic function to search files for lines (or other units of text) that contain a pattern.

938


What is filter_var?

925


Do you know what is the function func_num_args() used for?

973


What happens if an expected input field was not submitted?

910


What is the use of anonymous function in php?

932


What is variable give example?

973


What's the best method for sanitizing user input with php?

871


What is the function in PHP do not return a timestamp?

967


What are the advantages of stored procedures?

937


Why many companies are switching their current business language to php? Where php basically used?

887


What is scope of variable in php?

999