3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("Item1.10", "Item2.5", "Item3.0", "Item2.2", "Item4.50", "Item2.50"); $tempArray = array(); $newArray = array(); foreach($array as $value) { list($item, ) = explode(".", $value); if(!in_array($item, $tempArray)) { $newArray[] = $value; $tempArray[] = $item; } } print_r($newArray); ?>

preferences:
40.13 ms | 402 KiB | 5 Q