Home > php教程 > PHP源码 > body text

获取地址栏传递的参数

PHP中文网
Release: 2016-05-23 16:40:21
Original
1269 people have browsed it

获取地址栏传递的参数

<?php
	/*
	*
	*地址栏参数获取类函数
	*/
function getUrl(){
   $url = parse_url($_SERVER[&#39;REQUEST_URI&#39;]);
   parse_str($url[&#39;query&#39;],$queryArr); 
   unset($queryArr[&#39;page&#39;]);
   $queryStr = http_build_query($queryArr);				
   //将获取的地址数组重新组合成一个新的地址栏
   echo $url[&#39;path&#39;].&#39;?&#39;.$queryStr.&#39;&page=&#39;;
} 
?>
Copy after login

 以上就是获取地址栏传递的参数的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template