PHP get the current URL path of the function and server variables example

$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,

PHP printf output format usage sharing

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

Latest mobile phone number regular expression (PHP version)

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'

PHP Automatic output of the Select form function

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:

PHP implements keyword substitution with highlighted code

/* Useful: Highlight Keywords Requirements: All symbols in the reference article except HTML tags are replaced with respectively $rows [' Content ']=str_replace (" $rows [' Content ']=str_replace (">", ">", $rows [content]);

PHP to get Baidu included and Baidu snapshot time code

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:

Parse = = and = = = in PHP (double equals, three equals)

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

Get the current array value in the PHP array Getting Started tutorial

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

PHP captures spider Crawler's code share

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 ',

PHP regular matches 5 to 10 digits without duplicates

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

PHP gets several global variables for the domain name

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

The usage analysis of PHP function php_self

$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

Introduction to Zend Framework Auto-load classes

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_ '

PHP array Getting Started Tutorial Array_keys () function

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

PHP code example for creating a tag cloud

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 =

Introduction to the use of str_replace () character substitution functions in PHP

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 (

A simple example of PHP operational database

1, connecting the database $conn = mysql_connect (' 127.0.0.1 ', ' root ', ' root '); if (! $conn) { Die ("Connection failed". Mysql_error); } 2, select Database mysql_select_db ("test"); 3, send operation

Examples of common methods of Phpexcel

/** * 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_

PHP conversion XML for code sharing for arrays

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:

PHP extract () function usage Example

!--? php //export array as variable $a = ' Original '; $my _array = Array ("A" = "Cat", "b" = "Dog", "c" = "Horse"); Extract ($my _array);//bbs.it-home.org echo "\ $a = $a; \ $b = $b; \ $c = $c ";

Total Pages: 5208 1 .... 4811 4812 4813 4814 4815 .... 5208 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.