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

What is the use of strpos in php?

1052


How to enable cURL in PHP?

1149


How does csrf attack work?

1025


Which is better php or nodejs?

967


Why do we use cookie?

971


What is new static in php?

1001


What are the encryption functions in php?

1162


What is strcmp () in php?

985


What is difference between post and put in rest?

1028


What are php loops?

983


Differences between get and post methods?

1048


What is baseurl?

964


Can you give example for trait in php?

1017


How is it possible to know the number of rows returned in result set?

1011


Which functions are used to remove whitespaces from the string?

1153