How to trim some word in php? Example like
pid=\"5\" OR pid=\"3\" OR
I want to remove the last OR
OR
A regular expression would also work:
$str = 'pid="5" OR pid="3" OR'; print preg_replace('/\sOR$/', '', $str);