![]() |
Methods to iterate through an array
I was wondering in how many ways can we iterate through an array in PHP. So, I figured out a few, here's it...
Our Array, which we will be iterating on, PHP Code:
PHP Code:
PHP Code:
Code: PHP
PHP Code:
PHP Code:
|
Re: Methods to iterate through an array
Sorry for the bug which I overlooked, the function will run into infinite recursion, so the correct one should look like this.
PHP Code:
|
| All times are GMT +5.5. The time now is 16:05. |