I have a string in my DB like this 2,44,596,144,1,232
If a user selects say 44 (memberid) i want it removed, this best way i can think of doing this is exploding it then str_replace that value with nothing.
Problem i have is adding the rest back together so i can update the db again. This is what i have but it's wrong...
can someone please help
$respected = explode(',', $stringihave);
foreach($respected as $key=>$value) {
if ($value == $memberid) {
$update = str_replace ($value, "", $update);
}
$update2 = "$update + $value";
echo $update2;
}