Magento Engineer
social
Journal

How to remove/delete one value from comma seprated string in PHP?

$senderId=11;//want to remove this
$list = 4,5,11,22;
$array1 = Array($senderId);
$array2 = explode(',', $list);
$array3 = array_diff($array2, $array1);
$output = implode(',', $array3);//your result 4,5,22

Ad comes here
Comments
Leave A Comment
PHP blog
Update Cookies Preferences