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
What package you use to create a windows services?
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
What is the purpose of redo statement?
How to print escaping characters inside a string in perl?
Why should I use the -w argument with my Perl programs?
How to find the length of an array in perl?
What is the function of virtual documents in cgi programs?
What is epoch time in perl?
What is warn function in perl?
How many loop control keywords are there in perl?
What are the logical operators used for small scale operations? Explain them briefly.
How can you define “my” variables scope in Perl and how it is different from “local” variable scope?
How to access parameters passed to a subroutine in perl?
What does localtime() do in perl?
What's the difference between /^Foo/s and /^Foo/?