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
What is the use of strpos in php?
How to enable cURL in PHP?
How does csrf attack work?
Which is better php or nodejs?
Why do we use cookie?
What is new static in php?
What are the encryption functions in php?
What is strcmp () in php?
What is difference between post and put in rest?
What are php loops?
Differences between get and post methods?
What is baseurl?
Can you give example for trait in php?
How is it possible to know the number of rows returned in result set?
Which functions are used to remove whitespaces from the string?