Sometimes you need to spoof IP to crawl other Web content, the best is the domestic IP, the Internet to find a function, can randomly 10 IP segment of the domestic IP, I checked some of the IP data, manually added 5 IP, a total of 15 IP segments, so
SQL has many statements to manipulate the database. But common and comparative needs are so few statements the delete from statement is used to delete records from a database tableStatement: DELETE from table_name WHERE COLUMN_NAME = some_value
Database section:
CREATE TABLE ' username_list ' (
' id ' int () not NULL auto_increment,
' username ' varchar Character Set Lati N1 not NULL,
PRIMARY KEY (' id ')
) Engine=myisam DEFAULT Charset=utf8 collate=utf8_unicode_ci auto_increment=1
PHP generates an Excel file (CSV) reference code as follows:
The code is as follows
Copy Code
Header ("Content-type:application/vnd.ms-excel");Header ("Content-disposition:attachment;filename= www.111cn.net Test_data.xls"
PHP backup MySQL Database source code, in the perfect Php+mysql project, in the background will have backup MySQL database function, with this function, we will no longer use FTP or use MySQL management tools to download the MySQL database, very
Curl Implement get Submit data
The code is as follows
Copy Code
Initializes a CURL object$curl = Curl_init ();Set the URL you want to crawlcurl_setopt ($curl, Curlopt_url, ' http://www.111cn.net ');Set header, last
The code is as follows
Copy Code
? PhpRequire_once ("mssql.class.php");1. Create a class and connect to a database$DB = new MSSQL ("Dns=aaa;uid=sa;pwd=sa;dbname=test");2. Connecting to the database$conn = $db->config
The single case mode (Singleton) is also called the single State pattern, is the simplest pattern in the design pattern, even some model masters do not call it the pattern, called it a realization skill, because the design pattern pays attention to
PHP Automatic Recognition code, if there is Chinese, it is best to convert it to UTF-8, because the Chinese in GBK editing situation, there may be garbled, this and client and service-side coding are related, in order to avoid garbled, we can use
The use of foreach () in PHP
foreach () has two uses:
1:
The code is as follows
Copy Code
foreach (Array_Name as $value){Statement}
The array_name here is the array name you want to traverse, each time the
Recently used PHP to deal with about 7k of network data, the existing network situation, time-consuming usually a second, run the entire program about nearly two hours.
Because it is too long to run a data, so planning to implement parallel
Preg_match_all-performs a global regular expression match
int Preg_match_all (string $pattern, String $subject [, Array & $matches [, int $flags = Preg_pattern_order [, int $o Ffset = 0]]]
Cases
The code is as follows
Copy Code
Include ('Template. Inc'); // contains the template class template. inc.// Create an instance$ Tpl = new Template ("template ");// Read the content of the three template files, respectively, to the variables "main", "child_header", "child_footer"$
Related knowledge:1. 2. The template engine Smarty is a brief introduction to the Smarty technology, which is the essence of PHP. As the PHP version gradually increases, many of the original methods may be too outdated, next I will talk about how to
Abstract: In this article, we will discuss a lot of tips and considerations for building a basic server monitoring engine based on the PHP language, and provide a complete source code implementation.I. Change the working directoryWhen you write a
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