PHP regular problem, how to remove it? Content after the beginning
小可耐
小可耐 2019-07-22 00:04:33
0
1
1032

For examplehttp://www.baidu.com/xxxxxx.mp4?tag=MsjsIjdjajs

I need to remove it?tag=MsjsIjdjajs

小可耐
小可耐

reply all(1)
Peter-Zhu

This requirement is very simple. You don’t need to use regular expressions. String functions can handle it:

<?php

$str = 'http://www.baidu***/xxxxxx.mp4?tag=MsjsIjdjajs';

echo strstr($str, '?', true);

// 结果: http://www.baidu***/xxxxxx.mp4


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template