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
How to read a single line from a file in perl?
How the interpreter is used in Perl?
Why do you use Perl?
Who created perl?
For a situation in programming, how can you determine that Perl is a suitable?
What is perl scripting?
What happens when you return a reference to a private variable?
Explain goto label?
What is the usage of -i and 0s options?
How do I sort a hash by the hash key?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
What are the steps involved when the cgi program starts running?
How we can navigate the xml documents?
Write a program that shows the distinction between child and parent process?
Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.