3v4l.org

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