First, PHP gets the URL of the current page:
Copy the Code code as follows:
Get the current script URLfunction Getcururl (){if (!empty ($_server["Request_uri")){$scriptName = $_server["Request_uri"];$nowurl = $scriptName;}Else{$scriptName =
Php retrieves the current url and replaces the parameter or url. First, PHP retrieves the URL of the current page: Copy the code as follows: get the current script URL functionGetCurUrl () {if (! Empty ($ _ SERVER [REQUEST_URI]) {$ scriptName $ _
The first is PHP to get the current page URL:
Copy Code code as follows:
Get the current script URL
function Getcururl ()
{
if (!empty ($_server["Request_uri"]))
{
$scriptName = $_server["Request_uri"];
$nowurl =
Php implements static url pseudo-static url. I usually use apache, nginx, htaccess, and so on. php is rarely used to achieve static url. it is troublesome to use php to achieve static url, in my opinion, php is not recommended for url static. 1. the
The class that gets the URL information
Using this class, you can obtain the following information about the URL:
-Host
-Path
-Statuscode (eg. 404,200, ...)
-HTTP Version
-Server
-Content Type
-Date
-the whole header string of the URL
Copy
PHP retrieves the URL function instance of the current page and obtains the current url function. PHP retrieves the URL function instance of the current page. This article describes how PHP obtains the url function instance of the current page. The
A class for retrieving URL information implemented in php to obtain URL information
Using this class, you can obtain the following URL information:
-Host
-Path
-Statuscode (eg. 404,200 ,...)
-HTTP Version
-Server
-Content Type
-Date
-The whole
class to get URL informationUsing this class, you can get the following information for the URL:-Host-Path-Statuscode (eg. 404,200, ...)-HTTP Version-Server-Content Type-Date-the whole header string of the URL Copy CodeThe code is as follows:/***
First, PHP retrieves the URL of the current page:
CopyCode The Code is as follows: // obtain the current Script URL
Function getcururl ()
{
If (! Empty ($ _ server ["request_uri"])
{
$ Scriptname = $ _ server ["request_uri"];
$ Nowurl = $
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.