Remove Last charter from string in PHP
echo rtrim("Rizwan,", ","); //this will remove last
echo substr('a,b,c,d,e,', 0, -1); //remove last charter
substr_replace($string, "", -1);
echo rtrim("Rizwan,", ","); //this will remove last
echo substr('a,b,c,d,e,', 0, -1); //remove last charter
substr_replace($string, "", -1);