Tag Archives: php

Accessing Values by Referrence in a Foreach Loop

Here’s a fun little trick. When looping over an array, you can access the values by reference. Instead of: foreach ($things as $i => $thing) { $things[$i] = strtolower($thing); } You can reference the values of the array: foreach ($things … Continue reading

Posted in Uncategorized | Tagged | 3 Comments