Curl Library can be simple and effective to grasp the Web page, you only need to run a script, and then analyze the pages you crawl, and then you can get the data you want in the program. Whether you want to take part of the data from a link, or
Error_reporting () php.ini and http.conf configuration error messagesError_reportingConfigure the level of error message return.Syntax: int error_reporting (int [level]);return value: IntegerFunction type: PHP system function
This function is used
PHP Array Operation Instance TutorialEach cell in the data array represents a row in a table. This is the typical way the database holds array data.The data in the example are as follows:Volume | Edition-------+--------67 | 286 | 185 | 698 | 286 | 66
PHP Cookie Setcookie Use instance
Session and cookie functionality. Cookies are the easiest way to permanently maintain user information. Here I will give you a detailed explanation of the function of cookies and how to use them.
One: Set
PHP serialize,unserialize function
We often see serialize,unserialize these two functions in PHP, so what are their roles?
Serialize can convert any data into a stored character oh, and then unserialize restore, here we look at
An instance.
substr instance
$content = ' I love you www.111cn.net ';
$temp = substr ($content, 4);
Echo $temp;
Results:
Love you www.111cn.net '//
Let's take a look at the function from the right.
$temp = substr ($temp, 0,-4);
The results are:
I love
/*y:09.05.05A:jimmyLogin*/
The program starts with instructions.
Include ("inc/conn.php");Include ("inc/function.php");
Public files all include in
$integrals = get_value (' integrals ', 0);
$uid = get_value (' id ', 0);
Get the data writing
The following method can be used to quickly obtain image size information:1. Get the size information of JPEG images The code is as follows:Copy code /** Get the size information of JPEG images without the need to download/read the entire image.*
You can design anti-Leech protection for your host, including image anti-Leech protection and download anti-Leech protection, for example:Use. htaccess to set anti-Leech The code is as follows:Copy code RewriteEngine onRewriteCond %
The matching rule cannot use "// /I", because it cannot match the line break, so multiple lines of js won't match. To use "// // I ". Inside? Indicates that there are as few duplicates as possible, that is, matching the latest script.Source code
Example: use cooikes The code is as follows: Copy code Session_start ();// Save for one day$ LifeTime = 24*3600;Setcookie (session_name (), session_id (), time () + $ lifeTime ,"/");?>
For functions, we can use the following methods to directly set the timeout time for the function. The code is as follows: Copy code Declare (ticks = 1 );Function (){Sleep (10 );Echo "a
Let's look at an example.1, 2, 3, 4, 5If the five above are IDs, I want to sort the previous pages directly usingOrder by id descIf my current ID is3So we only use 2 for the next page.Order by id ascThe sorting result should be,4The principle is so
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