What do you think of the session? I do not know if you have studied, today the PHP training teachers want to share some of the content of this, I hope you can enjoy.How long is the session life cycle ?
1 The end of the browser's lifecycle also ends
Common functions
The code is as follows
Copy Code
Get domain name or host addressecho $_server[' Http_host ']. " "; #localhostGet Web page addressecho $_server[' php_self ']. " "; #/blog/testurl.phpGet URL
Object-Oriented Development summary
1. Description and configuration of the object. (Can be understood as a description of the output text of an object)2. A processing of object methods. (It can be understood that customizing more humane error
The so-called value pass, which means that only the value of the object is passed to the target object, which is equivalent to copy; The system will reopen a completely identical memory space for the target object.
A reference, that is, passing an
The code is as follows
Copy Code
? PhpInclude './admin/connect.php ';@extract ($db->get_one ("select * from Movieinfo where id= '". $_get[' id ']. "));$db->query ("Update movieinfo set playnum=playnum+1 where id= '". $_get[' id ']. "
/*The function to invoke Linux commands in the PHP tutorial isString exec (String command, string [array], int [return_var]);Such as
EXEC ("Vpopmail");
echo exec (' whoami ');
Look at one more example
function exec_enabled () {$disabled =
The code is as follows
Copy Code
Class Page extends MySQL{Public $page;Public $page _size;Private $table;Private $condition;Private $limit;Private $href;Private $action _value;Private $url _value;Paging initialization function
Multiple inheritance is not supported in PHP, what can we do if we implement code reuse to methods that use multiple classes? That's the combination. In a class, set another class as a property.
The following example simulates multiple inheritance.
/**La (3,5,8,11)LB (2,6,8,9,11,15)Merged into LC, arranged in order.In PHP, you can't use a function like sort!!!!**/
Class Union {var $lista = array ();var $listb = array ();var $LISTC = array ();function Getlenght ($arr) {//Get table lengthreturn
/*
The code is as follows
Copy Code
int Preg_match_all (string $pattern, String $subject, Array & $matches [, int $flags [, int $offset]]);
Searches for all patterns that match regular expressions and presents
The efficiency of Json_encode and json_decode is not more efficient than serialize and unserialize, the performance is about twice times different when deserializing, PHP 5.3 performs more efficiently than PHP 5.2.
The code is as follows
1. constructor function __construct
If the function is __construct in the class declaration, it will be treated as a constructor and executed when the object is established, but in PhP4, the name of the constructor is the same as the class name. Oh,
PHP3 Cryption is a very easy-to-crack, insecure encryption function, and should not be a very important thing to use. Although encryption is good, it will not impede the rigorous test of the sophisticated cracking program.But try it... this is a
POP protocol introductionThis article briefly describes the principles of receiving and MIME mail through POP3 protocol, provides two Practical PHP classes for receiving and MIME decoding, and provides samples for use. It is divided into two parts:
This class can be used in mass mailing mode. The Test environment is linux, and sendmail must be installed in the system before it can be used.If (! Defined ('mail _ CLASS_DEFINED ')){Define ('mail _ CLASS_DEFINED ', 1 );Class email {Function email (
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