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
Php obtains the complete URL of the current page, and php obtains the current url. Php gets the complete URL of the current page. When php gets the current url and uses PHP to write programs, we often want to get the URL of the current page. The
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 static page generation tutorial. let's review some basic concepts first.
I. PHP scripts and dynamic pages.
A PHP script is a server-side scripting program that can be mixed with HTML files by embedding methods, classes, function encapsulation,
PHP static page generation tutorial. let's review some basic concepts first.
I. PHP scripts and dynamic pages.
A PHP script is a server-side scripting program that can be mixed with HTML files by embedding methods, classes, function encapsulation,
One, PHP script and dynamic page.
PHP script is a server-side scripting, can be embedded and other methods and HTML files mixed, but also class, function encapsulation, such as the form of templates to the user request processing. In any way, the
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.