in PHP

PHP7 Array Iteration Trick

In this tutorial we're going to look into a look tip for dealing with PHP array iterations with PHP 7. When you're developing in PHP and need to iterate over an array you'll probably see something like this.

foreach($array['values'] as $value) { }

The problem with this is that you're assuming that the array will always have a key of values $array['values']. If this isn't set PHP will error saying that values is not defined. This is where you'll s

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email