时间:2021-07-01 10:21:17 帮助过:3人阅读
$s = 'a=ddddd&page=2334&www=2222';$s = 'page=1111&m=3234&o=r2345';$s = 'a=ddddd&wc=2334&page=plo';//这样比较正规parse_str($s, $a);unset($a['page']);echo http_build_query($a), PHP_EOL;//正则比较另类echo preg_replace('/(&?)page=[^&]+(&?)/e', '"$2"?"$1":""', $s);
这就是高啊。。
$s = 'a=ddddd&page=2334&www=2222';$s = 'page=1111&m=3234&o=r2345';$s = 'a=ddddd&wc=2334&page=plo';//这样比较正规parse_str($s, $a);unset($a['page']);echo http_build_query($a), PHP_EOL;//正则比较另类echo preg_replace('/(&?)page=[^&]+(&?)/e', '"$2"?"$1":""', $s);求拜师