3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function utils_removeDuplicates($str, $delimiter = ',') { if($str != '') { $str = implode($delimiter,array_unique(explode($delimiter, $str))); } return $str; } $data = "88, 99, 99,99, 100"; echo utils_removeDuplicates($data); //$a = preg_split( '/[, ]+/', $data, -1, PREG_SPLIT_NO_EMPTY );
based on gECZ8
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.2.8, 5.2.10 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
88, 99,99, 100
Output for 5.2.9
88, 99, 100
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/5N81m on line 12
Process exited with code 255.