Simply indicate:
Copy the Code code as follows:
Class Test {Private $_name = ';Public Function SetName ($name){$this->_name = $name;return $this;}Public Function GetName (){Echo $this->_name. "\ n";return $this;}}$link = new test ();Method
The usual variables are named by the following statements:
Copy the Code code as follows:
$a = ' Hello ';?>
A mutable variable name refers to the use of a variable's value as the name of the variable. In the example above, by using two $
Code
Copy the Code code as follows:
/** RC4 encryption algorithm* $pwd Key* $data the data to be encrypted*/function RC4 ($pwd, $data)//$pwd key $data need to encrypt string{$key [] = "";$box [] = "";$pwd _length = strlen ($PWD);$data _length =
Started PHP for some time, the recent I used some of the techniques to summarize, convenient later can be used directly:
Header"content-type:text/html; Charset=utf-8 ");require_once' phpexcel.php ';require_once' phpexcel\iofactory.php ';require_
first step preparation, second step installation
MYSQL
, the third step installs
PHP
, fourth Step installation
NGINX
, Fifth Step installation
MEMCACHED
and PHP extensions
After the server is first made, the individual prefers to reset the server
Although it is known that this parameter means "People's Republic of China", but the official document does not have such parameters, only Asia/shanghai, Asia/hong_kong and so on these parameters ah, why here can be set to RPC, which is the point of
Previously wrote an article about the weight of an array, but only one-dimensional arrays. The following functions can be used with two-dimensional arrays:
Copy the Code code as follows:
Two-dimensional arrays eliminate duplicate valuesfunction
On the top page of the page, add
Date_default_timezone_set (PRC); /* Transfer time to Beijing time, php5 default to Greenwich Mean Time */
Date ()
A: "AM" or "PM"
A: "AM" or "PM"
D: A few days, two digits, if insufficient 0; from "01" to "31"
D: Day
expires is a Web server response message header field that, in response to an HTTP request, tells the browser that the browser can cache data directly from the browser before the expiration time, without having to request it again.
Cache-control
Recognize and use PHP Super global variables
The super global variable, also known as a predefined variable, is a self-contained variable in the PHP system, which makes your programming easier and faster. The types of this include:
$GLOBALS
Contains
Just today friend XJB also encountered this problem, so wrote this note, the description of the problem and the resolution of the record.
Problem Description: Web-style, can link MySQL, but at the command line, but prompted:
Fatal error:undefined
But in the last few days it's been a bad day, with 90% of attacks that can't be intercepted, take a look at the stats:
IP attack and start time
Number of attacks
Place
Note
125.165.1.42
1, the use of fopen
Copy the Code code as follows:
$handle = fopen ("http://s.jb51.net/", "RB");$contents = "";while (!feof ($handle)) {$contents. = Fread ($handle, 8192);}Fclose ($handle);Echo $contents; The output gets the content.?>
Copy
Copy CodeThe code is as follows:
Here you can set up multiple users$passwd = Array (' ha0k ' = ' ha0k ',' HACKERDSB ' = ' HACKERDSB ');/* Set the alias of the command here */$aliases = array (' ls ' = ' ipconfig ',' ll ' = ' ls-lvhf ');if (!isset
In TP, we can use the following two ways to create a data table mapping object (I used temporarily)
First type: $Test = D (' Test ')
Second type: $Test = new Model (' Test ')
Although both of these can be select,insert,delete,udpate operations on
Copy the Code code as follows:
function Getadder ($x){return function ($y) use ($x) {return $x + $y;};}$adder = Getadder (8);Echo $adder (2); Prints "10"
Here, the Getadder () function creates a closed use parameter $x (the keyword "uses" The
Do not know how to solve, so put his space on the server also installed a MySQL, to solve the problem, today there is a problem, you can not also install a MySQL on this server, Search:
PHP remote connection MySQL slow, sometimes remote connection
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.