3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Super this is a test this is a test'; $arr = explode(' ', $string); $vals = array_count_values($arr); foreach ($arr as $key => $word) { if ($vals[$word] > 1) { unset($arr[$key]); } } echo implode(' ', $arr);

preferences:
48.21 ms | 1513 KiB | 5 Q