The former may be a little faster. The latter is a lot more readable. Choice is yours 😉
More Related Contents:
- How does PHP ‘foreach’ actually work?
- Single result from database using mysqli
- PHP How to determine the first and last iteration in a foreach loop?
- What is the best way to loop through this array in PHP?
- How to execute two mysql queries as one in PHP/MYSQL?
- How do I iterate over the results in a MySQLi result set?
- Can you ‘exit’ a loop in PHP?
- How to find the foreach index?
- How do you remove an array element in a foreach loop?
- How to loop through an associative array and get the key? [duplicate]
- PHP read sub-directories and loop through files how to?
- PHP hierarchical array – Parents and childs
- Looping a multidimensional array in php
- How do you loop through $_FILES array?
- How to insert an array into a single MySQL Prepared statement w/ PHP and PDO
- How do i count same values in an array and store it to a variable?
- Run a PHP script every second using CLI
- FOR loop performance in PHP
- PHP foreach loop through multidimensional array [duplicate]
- Loop a multidimensional array and only print two specific column values per row
- case-insensitive array_unique
- Multiple index variables in PHP foreach loop
- for loop vs while loop vs foreach loop PHP
- endforeach in loops?
- Loop over DOMDocument
- How to set an option from multiple options or array with different values to views as selected in select box using PHP
- looping a SQL insert statement with dates
- PHP array printing using a loop
- Twig for loop for arrays with keys
- PHP – Flushing While Loop Data with Ajax