PHP retrieves the functions and server variables of the current URL path:
Code:
Copy codeThe Code is as follows: $ Path =/usr/opt/../ECT/ABCD;
Echo $ _ server ['document _ root']. ""; // obtain the root variable of the server document
Copy codeThe Code is as follows:
// Pki encryption// Openssl extension must be enabled for pki encryption.
// Php. ini extension = php_openssl.dll extension
/* The pki mode is
* Public key encryption and Private Key decryption;
* Private key
Everyone may understand this. I guess the meaning of this interface, which is used to call the interface content in the implementation class in the method called later, let's take a look at it later.
Pay. php
Copy codeThe Code is as follows:
Method 1:According to the official manual, if the safe mode settings of the php tutorial are too harsh, the following situation may occur: although the file actually exists, it is also reported that the file does not exist.
Because the php. ini
When a group of friends collected the webpage last night, they found that the webpage obtained by file_get_contents was saved as garbled code locally, and Content-Encoding: gzip in the Response header
But it is normal in the browser.Because I have
JS is the front-end language, PHP is the background language, and the front and back-end are often unclear at the beginning (I did it at the beginning, and now I am also committing a crime ), my original idea was to regard the frontend and backend
IntroductionEven if you develop a new large PHP program, you must use global data, because some data requires different parts of your code. Some common global data includes program setting, database connection, and user data. There are many ways to
If you have installed xdebug, you can use xdebug_debug_zval () to display "zval" information. As follows:
Copy codeThe Code is as follows: $ Str = "jb51.net ";
Xdebug_debug_zval ('str ');
Result:
Str:(Refcount = 1, is_ref = 0 ),String 'jb51. net'
ODBC connection functionsOdbc_connect function: open an ODBC connectionOdbc_close function: closes an open ODBC connection.Odbc_close_all function: Close all open ODBC connectionsOdbc_pconnect function: open a continuously valid ODBC connection
ODBC
The simplest way is to add the following code directly to the php program code:
Copy codeThe Code is as follows: error_reporting (E_ALL ^ E_NOTICE ^ E_WARNING );
Disable all notice and warning errors.
Put this statement in the function inclusion
The PHP substr () function can split text. However, if the text to be split contains Chinese characters, you can use the mb_substr ()/mb_strcut function, mb_substr () the usage of/mb_strcut is similar to that of substr (), but an additional
Mb_convert_encoding is used to convert the encoding. I have never understood the concept of program encoding, but now it seems a bit open.
However, the English language generally does not have Encoding Problems. Only Chinese data can have this
Here I want to summarize some information about the path where the URL and file in the address bar belong to me:With $ _ SERVER [], we can accomplish many things: it is an array containing headers, path information, and script positions. The array
JSON (JavaScript Object Notation) is a lightweight data exchange format.
In short, both xml and json are used to facilitate data exchange between the client and the server, especially for Object-type data, such as the most common array.
The
PHP provides two methods for regular expression text processing. One is the PCRE method (the PCRE Library implements a slightly different syntax and semantics from perl 5 (see below) function set of the regular expression pattern matching function.
Code
Copy codeThe Code is as follows: // obtain the start time and end time of the week of the specified date.
Function getWeekRange ($ date ){
$ Ret = array ();
$ Timestamp = strtotime ($ date );
$ W = strftime ('% U', $ timestamp );
$ Ret ['sdate']
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