Simple preg_replace

后端 未结 4 962
终归单人心
终归单人心 2021-02-05 13:06

I cant figure out preg_replace at all, it just looks chinese to me, anyway I just need to remove \"&page-X\" from a string if its there.

X

4条回答
  •  名媛妹妹
    2021-02-05 13:33

    preg_replace('/&page-\d+/', '', $string)
    

    Useful information:

    Using Regular Expressions with PHP

    http://articles.sitepoint.com/article/regular-expressions-php

提交回复
热议问题