3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [ 'foo', 'foo', 'bar', 'baZ', 'baz', 'fÖo' ]; $arrRes = []; $arrLower = []; foreach ($arr as $v) { $lower = mb_strtolower($v, 'utf-8'); foreach ($arrLower as $lower2) { if ($lower === $lower2) { continue 2; } } $arrRes[] = $v; $arrLower[] = $lower; } var_dump($arrRes);
based on 1spDZ
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
array(4) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baZ" [3]=> string(4) "fÖo" }