php: regex remove bracket in string

前端 未结 4 2020
醉话见心
醉话见心 2021-01-22 05:16

similiar like this example, php: remove brackets/contents from a string? i have no idea to replace

$str = \'(ABC)some text\'

into



        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-22 05:50

    I'd avoid using regex altogether here. Instead, you could use normal string functions like this: $str = str_replace(array('(',')'),array(),$str);

提交回复
热议问题