URL操作
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了URL操作相关的知识,希望对你有一定的参考价值。
$a = $_SERVER['HTTP_HOST'] // server-name - domain $c = $_SERVER['QUERY_STRING'] // everything after the "?", // but not including the "?" echo "$a$b?$c"; // would print whole URL $d = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; // notice the "?" in middle of the above, and variables seprated by dots(.) // $_SERVER['QUERY_STRING'] reads url GET query, but does not contain // the "?" in it itself, since "?" is not a variable. echo $d; // would print the whole URL using above.
以上是关于URL操作的主要内容,如果未能解决你的问题,请参考以下文章