3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function utils_removeDuplicates($str, $delimiter = ',') { if($str != '') { $str = implode($delimiter,array_unique(preg_split('~,\s*~', $str))); } return $str; } $data = "88, 99, 99,99, 100,1 0 0, 88 , 43, 88 "; echo utils_removeDuplicates($data);
based on DaWrR
Output for 4.3.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
88,99,100,1 0 0,88 ,43