How to trim text using PHP

前端 未结 5 1047
闹比i
闹比i 2020-12-21 01:54

How to trim some word in php? Example like

pid=\"5\" OR pid=\"3\" OR

I want to remove the last OR

5条回答
  •  时光说笑
    2020-12-21 02:14

    What do you think about this?

    $str='pid="5" OR pid="3" OR';    
    $new_str=substr($str,0, strlen($str)-3);
    

提交回复
热议问题