I found myself in a situation where I needed to remove duplicates from a comma delimited string urgently, and used the following bit of PHP:
//ex.) $string = '23,23,24,25,26'
$result = implode(',', array_unique(explode(',', $string)));
I found myself in a situation where I needed to remove duplicates from a comma delimited string urgently, and used the following bit of PHP:
//ex.) $string = '23,23,24,25,26'
$result = implode(',', array_unique(explode(',', $string)));