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 default session time in php?
How do you count numbers in php?
How to delete an element from an array?
What are the differences between echo and print?
How do I check if a given variable is empty?
Do you know what is use of count() function in php?
What is difference Between PHP 5 and 7?
Is empty in php?
What does the unset() function mean?
Is apache needed for php?
What is PHP? Who is the father or inventor of PHP?
How to send email using php script?
How will you calculate days between two dates in PHP?
What are escaping characters?
How can you retrieve data from the mysql database using php?