How to remove content from url after question mark. preg_match or preg_replace?

后端 未结 2 963
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-20 14:01

Im working on some function to grab few data from url with simple html dom.

But one of the data is an image and image have question mark and some more info behind it

2条回答
  •  情深已故
    2021-01-20 14:54

    In a much easier way it could be:

    $iWantThisURL = substr($curr_url(), 0, stripos($curr_url, '?'));
    

提交回复
热议问题