$path =/var/www/. /ECT/ABCD;
echo $_server[' Document_root ']. ""; Get the server document root variable (depending on the configuration in http.conf)
echo $_server[' php_self ']. ""; Gets the path to the file that executes the code,
Main ()
{int a =-1;
printf ("%d,%o", A, a);
}
Copy CodeRunning results: -1,177777 program Resolution: 1 in the memory unit (in the form of complement) for (1111111111111111) 2, converted to octal number is (177777) 8. ③X
In this paper, the use of regular expressions to verify the mobile phone number method, you can verify the latest mobile phone number segment, including 150, 158, 159, 188 and so on. Please refer to the friends who are in need.Before, the programmer'
This article introduces, with PHP automatic output (construction) of a select form a function, the need for friends to refer to it.The following function implements: Automatically generate the option item for select.The code is as follows:
This article introduces, using PHP to get Baidu included, as well as Baidu snapshot time of a piece of code, there is a need for friends, make a reference bar.PHP code to implement the query Baidu included the situation and Baidu snapshot time.Code:
if ($config [' Urlrewrite ']==1)
Or
if ($config [' Urlrewrite ']=== ' 1 ')
To judge.
Copy CodeDescription: $a = = $b;//Equal True if $a is Equal to $b. $a = = = $b;//Identical TRUE if $a is Equal to $b, and they is of the same
This article describes the PHP array to take the current array of values of the method, there is a need for a friend reference.In the operation of the PHP array, you can use the current () function to return the array value in the array where the
This article describes the PHP implementation of crawling Spider Crawler traces of a piece of code, there is a need for friends reference.Using PHP code to analyze the Spider crawler traces in the Web log, the code is as follows:
' Googlebot ',
It is convenient to match numbers with regular expressions, and here we introduce the method of matching 5 to 10 digits without repetition for your reference.Matches a duplicate of 5 to 10 digits, the regular expression can write: \d{5,10}.To match
Get the current domain name:
echo $_server[' server_name '];//get the source URL, that is, click to the previous page of this page URL
echo "";
echo $_server["Http_referer"]; Gets the suffix of the previous page domain name
$php _self? variable name = value (instance: $php _sefl?id=0)
Copy CodeThe variable name that follows the question mark is custom, and is typically named in the English name (which can be abbreviated) that is more readable, as needed. For
This paper introduces the method of calling automatic loading class in Zend Framework framework for reference.1, automatic loading of classes in modules
The ' Blog ',//namespace definition is the method at the beginning of the Blog_ '
This article describes the use of the Array_keys () function in the PHP array, as required by a friend reference.In the PHP array function, the Array_keys () function returns an array that contains all the keys found in the searched array.The form
This article describes a piece of code that creates a tag cloud with PHP, creating a tag cloud effect from a custom PHP function. Refer to a friend who needs it.An example of creating code for the PHP tag cloud is as follows: $count) {$size =
This article describes the use of the Str_replace () function in PHP, and related examples. If you need a friend, refer to it.Define and use the Str_replace function to replace some other characters in a string with a string. The syntax Str_replace (
/**
* Phpexcel Usage Example
* by bbs.it-home.org
* ################
*/
To set the include path for the Phpexcel class library
Set_include_path ('. '). Path_separator.
' D:\Zeal\PHP_LIBS '. Path_separator.
Get_
How do you convert XML data to simple, readable array data? This article share this piece of code, can realize this function, have the need of friends to see it.The following code implements the ability to convert XML to an array. Example:
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service