How to add php Curl extension under Linux
General PHP Source Extension Library has been with the extension of curl, so there is no need to download, directly compiled extension can be
The steps are as follows:1. Go to the corresponding extension
php Simple page pagination code implementation
/*** @todo pagination* @param $count Total number of bars* @param $pagesize Show the number of bars per page* @param $nowpagenum Current page* @return String HTML* @example* $count = 45; The total
PHP Get User IP code implementation
Getting a client User IP is often required in the Web site, such as:
1. Login IP: You can know in time whether your account is stolen;
2. Voting: can only do one vote per IP to prevent the swipe ticket;
3.
Share a function code that uses PHP to get remote pictures and save remote picture downloads to Local:
/** Function: PHP perfect implementation download remote picture saved to local* Parameters: File URL, save file directory, save file name, use
Saving an array in a PHP cookie
A cookie is a string of strings that cannot be stored as an array. Therefore, the cookie is not stored in the default array, the following syntax is wrong.
$arr = Array (+/-);Setcookie (' A ', $arr);
The error
PHP punctuation Full-width conversion to half-width method
Turning the full-width of Chinese into a half-width symbol is actually the second byte of all Chinese punctuation minus 0x80 (that is, 128) the number obtained is the half-width of the
The difference between a cookie and a session in PHP:
1. The cookie data is stored on the client's browser and the session data is placed on the server.
2, the cookie is not very safe, others can be stored in the local cookie and cookie spoofing,
PHP Security Filter String function
Share a PHP filter string function with the following code:
function striphtml ($string) {$pattern =array ("' Si", "'
]*?>.*? ') Si ", " ' ]*?> ' si ', ' ' ([\ r \ n]) [\s]+ ' ", " ' & (quot| #34);
PHP Get configuration information function: Ini_get detailed
Functions: Ini_get (PHP 4, PHP 5)
Function: Gets the value of a configuration option, which is the value of the environment variable in the php.ini.
Base syntax: String Ini_get (String
PHP Determines if there is an intersection of two arrays, and the function code is as follows:
/*************** determine if there is an intersection of two arrays ******************/function Get_array_intersection ($array _a, $array _b) {if
When developing a Web site in PHP, it is common to convert two data types to each other for use.
Here's how the PHP object and the PHP array will be converted to each other:
(1) How to change the PHP object to array:
/*** Object to
Between the browser and the server is a non-connected HTTP protocol for communication, for the non-connected program is characterized by the client Request server, the service side according to the request output the corresponding program, can not
A reference to PHP (that is, a variable or function or object or object method preceded by A & symbol) is referenced in PHP to mean that different names access the same variable content.
There is a difference between the pointers in the C language.
How does PHP tell if a remote file exists?
Here are the methods that the authors find on the web, and share them here.
PHP to determine if a remote file existsfunction Url_exists ($url) { $handle =curl_init ($url); if (false=== $handle)
In the PHP program writing, develop the programming habit of writing log file, is a good programming habit, programmers should learn this kind of programming idea, not too impetuous. Early programming is not rigorous, often bring later maintenance
Serialization is the process of converting a variable into a string that can be saved or transmitted, and deserialization is the conversion of the string to the original variable at the appropriate time.
Together, these two processes make it easy
When you try to use an undefined class, PHP reports a fatal error. The workaround is to add a class that can contain a file with an include. After all, you know which class to use. However, PHP provides automatic loading of classes, which can save
PHP intercepts the specified number of Chinese string functions.
First, the string for the test:
Header ("Content-type:text/html;charset=utf-8");echo Cn_substr_utf8 (' I am a, and Ha, OH also,, country! ', 12);Echo '', Cn_substr_utf8 (' ai\
Share a function method that uses PHP to obtain the corresponding Ganzhi, Zodiac, and constellation information based on date or time stamp.
The specific function code and how to use it are as follows:
/**Judging Ganzhi, Zodiac and
Recently Baidu moves quite big, the search algorithm frequently adjusts. Just in the analysis of this site Baidu included in the situation and found that Baidu search results connected unexpectedly also changed, presumably this is to deal with 360
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