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 an example of a variable?
Is age interval or ordinal data?
What are the main error types in php and how do they differ?
Write logic to print Floyd's triangle in PHP?
Explain how does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?
Php code to find whether a number armstrong or not?
Is php procedural or oop?
What is the use of htmlentities in php?
How to calculate the difference between two dates using php?
Tell me how to find current date and time?
How would you open a directory for reading in php?
Why php is used in html?
What is meant by pear in php? What is the purpose of it?
What is the difference between indexed and associative array?
Tell me how to initiate a session in php?