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


Please Help Members By Posting Answers For Below Questions

What is composer json?

493


Can we extend multiple classes in php?

537


What is memcache?

538


What is difference between static and final in php?

523


What is php regular expression?

500






What is the use of imagetypes() method?

535


What is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

527


What is the importance of php?

517


What is different between software and app

1227


Explain what does $_server means?

570


What is the importance of parser in php?

604


Explain what are some new features introduced in php7?

485


Which is not a php magic constant?

572


Where are the persistent cookies stored on your computer?

570


Is null in php?

530