what is the diffrence between for and foreach?
Answer Posted / krunal gohel
for loop is to do something over and over again until the
task has been completed.
foreach works only on arrays. even it will run the loop
until end of the array.
Is This Answer Correct ? | 15 Yes | 6 No |
Post New Answer View All Answers
What language is php written in?
What is rtrim php?
What is default session time and path in PHP. How to change it?
What are php string functions?
Explain me what are the main error types in php and how do they differ?
How arrays are passed through arguments?
Tell me how to get the value of current session id?
What is filter_var?
What does $_env mean?
Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.
What is use of htmlspecialchars php?
Tell me how do you define a constant?
Where is session id stored?
Why print_r is used in php?
Which function would you use to read a line of data from a file in php?