I want remove duplicate value from a string, so I'm using this code:
$new_order = '49850, 49850, 49851, 49852, 49853, 49854';
$new_order = implode(',', array_unique(explode(',', $new_order)));
output:
string(40) "49850, 49850, 49851, 49852, 49853, 49854"
but should be:
string(40) "49850, 49851, 49852, 49853, 49854"