How to trim some word in php? Example like
pid=\"5\" OR pid=\"3\" OR
I want to remove the last OR
OR
Using substr to find and remove the ending OR:
$string = "pid='5' OR pid='3' OR"; if(substr($string, -3) == ' OR') { $string = substr($string, 0, -3); } echo $string;