What is Snoopy? (Download Snoopy)
Snoopy is a PHP class that mimics the functionality of a Web browser, which accomplishes the task of getting web content and sending forms.
Some features of Snoopy:
* Easy to crawl the content of the webpage
* Easy
PDO is a significant feature of new PHP 5, since php4/php3 before PHP 5 is a bunch of database extensions to connect and process with each database, what Php_mysql.dll, Php_pgsql.dll, Php_mssql.dll, Php_ Sqlite.dll and so on extension to connect
Object-oriented approach
Let's take a look at the error handling of the PDO in PHP, if the connection error is handled, using an object-oriented approach:
Copy CodeThe code is as follows:
try {
$db = new PDO (' Mysql:host=localhost;dbname=test ', $
PHP handling of case-sensitive issues is messy, writing code may occasionally problem, so here to summarize.
But I'm not encouraging you to use these rules. We recommend that you always adhere to the "case sensitive" and follow the Uniform Code
Copy CodeThe code is as follows:
/* Function Array_push (): Presses one or more cells into the end of the array (into the stack)
* 1, Syntax: int array_push (array &array, mixed var [, mixed ...])
* 2, Description: The array is treated as a stack,
General idea, every promotion to create a new promotion class, there is a special switch to control whether or not to take effect.
Use the promotional identification code in the product to determine which promotion instance to call.
First of all,
Recently, when looking at a cow's code, see a very useful function: Extract (), its main function is to expand the array, the key name as the variable name, the element value is the variable value, you can say that the operation of the array
Simple Factory mode:
① abstract base class: Some methods of defining abstractions in classes to implement in subclasses
② inherits from the subclass of the abstract base class: Implementing an abstract method in a base class
③ Factory class: Used to
Seemingly simple things, in practical use, is still very interesting
arithmetic operatorsOperator name Result
$a + $b addition $a and $b and
$a-the difference between $b subtraction $a and $b
$a * $b multiplication $a and the product of $b
$a/$b
GPC filtering, automatic escape of special characters in $_get,$_post,$_cookie to prevent SQL injection attacks
$_get = Saddslashes ($_get);
$_post = Saddslashes ($_post);
Copy CodeThe code is as follows:
The following is an example of daddslashes (
PHP fgetcsv Definition and usage
The PHP fgetcsv () function reads a line from the file pointer and resolves the CSV field.
Like PHP fgets (), the difference is that PHP fgetcsv () parses a read-in row and finds a field in CSV format, and then
One, Apache server security settings1, to nobody users to run
In general, Apache is installed and run by root. If the Apache server process has root user privileges, it poses a significant threat to the security of the system and should ensure that
PHP built-in variables: directory_separatorDirectory_separator is a PHP built-in command that returns the path delimiter associated with the operating system, back on Windows/, and on Linux or Unix-like, that's the difference, This is usually used
When the Windows Server opens the PHP GD library, the results of phpinfo () after using CGI do not appear gd in the Configure Command.
Configure Command is displayed after theIs:
Copy CodeThe code is as follows:
1 Cscript/nologo configure.js
Require_once ('.. /class.phpmailer.php ');
$mail = new Phpmailer ();
$body = "I finally sent the mail successfully!" Oh! Goodboy xxxxxxx!
Http://news.qq.com/a/20111115/000792.htm?qq=0&ADUIN=594873950&ADSESSION=1321316731&ADTAG=CLIENT. qq.3493_.0
First, let's review the structure of Zval:
Copy CodeThe code is as follows:
struct _zval_struct {
/* Variable Information */
Zvalue_value value; /* Value */
Zend_uint RefCount;
Zend_uchar type; /* Active type */
Zend_uchar Is_ref;
};
The RefCount
Mod_gzip is an Apache module whose function is to compress static HTML pages using gzip, and the browser that adheres to the IETF standard can accept gzip encoding (IE, Netscape, etc.). Mod_gzip can increase the download time of the page by up to 4-5
Recent projects need to look at the size of the data user table, including the number of record bars and the number of disk space occupied. On the internet for a long time it is possible to view the size of each table in the MSSQL database relative
Memcacheq is a simple distributed Message Queuing service.
One, the application background of MemcacheqWhat is in the Web App
Do you need a message queue? The main reason is because in high concurrency environment, due to too late synchronous
Session Start
Session_Start (); Start a session, if you want to use the session program, you must add this sentence
$_session[' user_id ' = ' 123 ';//Assign a value to a SESSION variable if the variable does not exist to create
echo $_session['
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