Do you want to put your pants off and fart? you can see a piece of code written in this way $ site_url & nbsp; strtolower (. $ _ SERVER [HTTP_HOST]. substr ($ _ SERVER [PHP_SELF], & nbsp; 0, & nbsp; strrpos ($ _ SERVER [PHP_SELF], & nbsp; index. php)
In php, we need to use several common php global variable functions to obtain the complete url of the current page. these variables are mainly $ _ SERVER, next, let me show you how to get an image
In php, we need to use several common php global
PHP example Tutorial: program code for the number of online users of the website, which is supported by the MYSQL database in the background. You can directly count the number of online users of the website.
PHP example Tutorial: program code for
The program code of the number of online users of the website, which is supported by the MySQL (the best combination with PHP) database in the background. You can directly count the number of online users of the website.
First, create a MySQL
What does this code mean? the following code cannot tell the number, where is it? it's messy.
$ Site_url = strtolower ('http ://'. $ _ SERVER ['http _ host']. substr ($ _ SERVER ['php _ SELF '], 0, strrpos ($ _ SERVER ['php _ SELF'], '/index. php ')
In php, deleting repeated element in an array is an available function, that is, array_unique (). However, it is not the most efficient method. Using the array_flip () function will be more efficient than the array_unique () function () the speed is
Abstract: In php, deleting repeated element in an array is an available function, that is, array_unique (). However, it is not the most efficient method, and array_flip () is used () the function will be about five times faster than array_unique ....
The header () does not seem to jump to seek help. it only receives data comparison and points to two php pages respectively. the php pages are all in one path. The form does not respond after it is submitted...
$ Username = $ _ POST ['username'];
$
Summary of common predefined variables in php. Copy the code as follows :? Phpecho current operating system information. PHP_ OS .br; echo path and FILE name of this FILE:. _ FILE _. br; echo current PHP version information. PHP_VERSION.br
The code
This article mainly introduces the differences between PHP_SELF, SCRIPT_NAME, and REQUEST_URI. For more information, see $ _ SERVER [PHP_SELF], $ _ SERVER [SCRIPT_NAME]. $ _ SERVER ['request _ URI '] is very similar in usage. they return information
PHP static class. Copy the code as follows :? PhpclassShtml {var $ Templet; var $ DataSource; var $ Dir; var $ fileName; var $ mod; var $ handle; functionShtml ($ fileName) {$ this-fileName $ fileName; $ this-
The code is as follows:
Class Shtml{
The PHPURL address obtains the function code (port, etc.). after reading this code, you can directly use it instead of reading it. Php obtains the current script URL (only Path)
The code is as follows:
Function GetCurUrl ()
{
If (! Empty ($ _
PHP_SELF, SCRIPT_NAME, and REQUEST_URI are different. requesturi. Differences between PHP_SELF, SCRIPT_NAME, and REQUEST_URI: Difference between requesturiPHP_SELF, SCRIPT_NAME, and REQUEST_URI $ _ SERVER [PHP_SELF], $ _ SERVER [SCRIPT_NAME], $ _
Obtain the php code of the url address of the current page. The first is a method for obtaining a URL without parameters. The second is to obtain the complete URL function. If you are looking for the url parameter code.
Obtain the php tutorial code
Recommended functions:First, PHP obtains the URL of the current page: dedecms also uses thisCopy codeThe Code is as follows:// Obtain the current Script URLFunction GetCurUrl (){If (! Empty ($ _ SERVER ["REQUEST_URI"]){$ ScriptName = $ _ SERVER
This article mainly introduces the differences between PHP_SELF, SCRIPT_NAME, and REQUEST_URI. For more information, see
This article mainly introduces the differences between PHP_SELF, SCRIPT_NAME, and REQUEST_URI. For more information, see
$
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 introduction to getting current url path functions and server variables
We will introduce the functions for getting the current url path in php and some server variables in php for your reference.Mainly used: $ _ SERVER ["QUERY_STRING"],
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.