PHP 5.3: Now With 40% Less Ugh!
C’est functional programming:
array_walk($line, function (&$i) { $i = trim($i); });
Or, at least, close enough. Either way, a vast improvement over the old method.
Also nifty: the ternary shortcut: ($a ?: $b) is just like ($a ? $a : $b), but without the double evaluation.
It’s a nice little update.
