Share a php code for getting keywords from Baidu search to enter the website. For more information, see:Code:Copy codeThe Code is as follows:Function search_word_from (){$ Referer = isset ($ _ SERVER ['HTTP _ referer'])? $ _ SERVER ['HTTP _ referer']
Set the session to use memcache for storage
Method I: global settings in php. iniSession. save_handler = memcacheSession. save_path = "tcp: // FIG: 11211"
Method II:. htaccess under a directoryPhp_value session. save_handler "memcache"Php_value
The static keyword declares that an attribute or method is related to a class, rather than a specific instance of the class. Therefore, such attributes or methods are also called "class attributes" or "class methods ".
If the access control
Let's talk about $ _ GET () and $ _ POST () today ().
In fact, it is easy to understand. It can be seen from the surface that it is to obtain the data of the post and get forms. In fact, this is also the case. If you want to be professional,
The $
Copy codeThe Code is as follows:$ User = trim ($ _ GET ['user']);$ D = $ _ GET ['date'];If (! $ D ){$ D = date ('ymmd', time ()-86400*14 );}If (empty ($ user )){Echo "Example: svn_log.php? User = wang & date = 20130118 ";Exit;}
$ Cmd = '/usr/bin/svn
The Code is as follows:
Copy codeThe Code is as follows:/**** My Calendar* Date_default_timezone_set date mktime* @ Param int $ year* @ Param int $ month* @ Param string $ timezone* @ Author fc_lamp*/Function myCalender ($ year = '', $ month ='', $
$ Total = 1225.49.5;$ Total = floor ($ total * 0.95) * 10)/10;
$ Total = sprintf ('%. 1f', (float) $ total );
Echo $ total;
?>
Output result: 1225.4
Several Methods for retaining the last decimal point in php
$ Total = number_format (2
1. _ toString: when an object is printed, if this method is defined by this class, the return value of this method is printed; otherwise, the result is printed Based on the default PHP behavior. This method is similar to toString () in Java (). Copy
fast and stable system architecture developed using PHP + MySQL, clear and intuitive directory structure The modular development mode ensures fast and stable system powerful secondary development capabilities native PHP writing and modular
Read data
$ M = new Model ('user ');
$ M = M ('user ');
Select
$ M-> select (); // obtain all data and return it as an array
Find
$ M-> find ($ id); // obtain a single data record
GetField (field name) // obtain a specific field value
$ Arr = $ m->
ThinkphpReturnJsonData format
// Write the class method using $ this-> ajaxReturn () to return the public function index () {$ setting = M ('setting '); $ map ['lang '] = array ('in', '1, 0'); $ data = $ setting-> where ($ map)-> field ('name, data
Copy codeThe Code is as follows:* Screen snapshot$ Im = imagegrabscreen ();Imagepng ($ im, "myscreenshot.png ");
* Capture a window (IE is used as an example)
$ Browser = new COM ("InternetExplorer. Application ");$ Handle = $ browser-> HWND;$
It is very convenient to implement the verification code in php. The key point is to master the usage of the php gd library and session.
Looking at the online php verification code generation example, there is no combination of php gd library and
Copy codeThe Code is as follows:Header ("Content-type: text/html; charset = utf8 ");/** Submit a request* @ Param $ header array set the array ("Host: devzc.com") for the domain name and other headers to be configured ");* @ Param $ data string the
The connection type is the same as that of ALL. The difference is that it only scans the index tree. It is usually faster than ALL because the index file is usually smaller than the data file. MySQL uses this connection type when the queried field
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