Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between for & foreach, exec &
system?

Answer Posted / raj

Ofcourse the syntax is completely different but the only
difference is
foreach simply gives an easy way to iterate over arrays.
foreach works only on arrays,
and will issue an error when you try to use it on a variable
with a different data type or an uninitialized variable
where as for loop works on the count length or what ever
please look in to php.net site for reference.

Thanks,
Raj

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the program to process a list of numbers.

986


Why should I use the -w argument with my Perl programs?

958


what is the difference between java and cgi?

1071


What is the difference between use and require in perl programming?

929


What does undef function in perl?

944


Define dynamic scoping.

884


How to concatenate strings in perl?

1037


What are hashes?

935


What is a perl references?

923


Explain the functioning of conditional structures in perl.

945


What is confess function in perl?

935


How can you replace the characters from a string and save the number of replacements?

891


What is the importance of perl warnings?

1138


What are the advantages and disadvantages of perl language?

916


Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)

998