(1) The static method is four times faster than the normal method.(2) echo output is faster than print(3) Use the connection character instead.(4) take the maximum value before the loop, instead of taking the value in the loop.Correct Method$ Max =
Reads data from all rows in a CSV file at a time.
CopyCode The Code is as follows: $ File = fopen('windows_201511s.csv ', 'R ');
While ($ DATA = fgetcsv ($ file) {// read the contents of a row in the CSV each time.
// Print_r ($ data); // This is
Let's take a look at the following online test code:
Copy codeThe Code is as follows: $ A = 9.45*100;
Var_dump ($ );
Var_dump (intval ($ ));
$ A = 945*1.00;
Var_dump ($ );
Var_dump (intval ($ ));
?>
Running result: float (945) int (944) float (945
Now we have such HTML file testjsonp.html under the domain name www.test.com:
Copy codeThe Code is as follows:
Untitled Page
Note: To truly run the above Code, you may need jquery files, you can change to the file path of jquery in your
Array_merge discards the key of the original number, retains the key in the string form, and then forms a new array. no matter whether the key name is the same or not, it is not merged, unless the key name and value are the same and must also be a
In PHP, arrays are often used as stacks (first-in-first-out: LIFO) and queues (first-in-first-out: FIFO. PHP provides a set of functions for pushing, pop (stack), and shift and unshift (Queue) to operate on array elements. Stacks and queues are
Folder content cannot be cleared. Only the specified link cache can be cleared.
Copy codeThe Code is as follows: Function clearVarnish ($ ip, $ url, $ host = null ){
$ Errstr = '';$ Errno = '';$ Varnist_arr = isset ($ host )? $ Host: C ('varnish _
Copy codeThe Code is as follows: Function map ($ fun, $ list, $ params = array ()){
$ Acc = NULL;
$ Last = array_push ($ params, NULL, $ acc)-1;
Foreach ($ list as $ params [$ last-1]) {// This method is amazing for the first time.
$ Params [$
Copy codeThe Code is as follows:
// Define the size of the thumbnail.$ PicSize = array (
'1970 _ 100' => 1,
'2017 _ 000000' => 1
);
$ ImagePath = "../image /";
Function parseUrl ($ url ){
Preg_match ("/(? P [\ w \ d] +) _ w (? P \ d +) _ h (? P \
Php_screw is really good, but it can only play the role of encryption, and does not play the role of acceleration and optimization.
Let's take a look:
Turck MMCacheIt accelerates and optimizes php code by compiling php code. If the released php code
I use winXP for local development, but the uploaded server is linux. I always need to change the configuration file before each upload, and there are other things,
Now, by determining the type of the current server to determine what program to
The problem that is often encountered during collection is the problem of content formatting. After some time, I wrote a function that replaces html tags and styles with regular expressions, sharing them.
Copy codeThe Code is as follows :/**
*
The fopen () function is used to open a file in PHP.The first parameter of this function contains the name of the file to be opened, and the second parameter specifies the mode used to open the file:
Copy codeThe Code is as follows: $ File = fopen (
This article describes three methods for generating static html files in Php.
1. The following is a template method!
Copy codeThe Code is as follows: $ Fp = fopen ("templets.html", "");
If ($ fp ){
$ Fup = fread ($ fp, filesize ("templets.html "));
As follows:
Copy codeThe Code is as follows: $ T = new executeTime;
Phpinfo ();
Class executeTime {
Private $ microtime;
Public function _ construct (){
$ This-> microtime = microtime (true );
}
Public function getNow (){$ This->__
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