3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phrases = array("Aaa", "abb", "acc", "bbb", "bb2"); $groups = array(); foreach($phrases as $phrase) { $firstLetter = mb_strtoupper($phrase{0}); $groups[$firstLetter][] = $phrase; } print_r($groups);

This is an error 404

There are `0` results


preferences:
147.51 ms | 1390 KiB | 7 Q