2018-04-20获取网页url的参数值
2018-04-20 本文已影响15人
keaidelele
<?php
$src = "http://www.baidu.com?u1=us&u2=hui";
$query = parse_url($src,PHP_URL_QUERY);
parse_str($query,$params);
$test = $params['u2'];
echo $test;
?>
<?php
$src = "http://www.baidu.com?u1=us&u2=hui";
$query = parse_url($src,PHP_URL_QUERY);
parse_str($query,$params);
$test = $params['u2'];
echo $test;
?>