PHP compresses HTML page code (clear spaces, line breaks, tabs, comment markers).
A good way is to compress the HTML, compressed HTML is actually: Clear line breaks, clear tabs, remove the comment mark. The role it plays is not to be underestimated.
The first class of methods is done using arrays. First cut the file name into the array, and then find a way to get the last element of the list is OK. The second class of methods is done through the processing of strings, and one method is to use
Libcurl also supports HTTPS authentication, HTTP POST, HTTP PUT, FTP upload (This can also be done via PHP's FTP extension), HTTP forms-based uploads, proxies, cookies, and Username + password Authentication.
PHP's curl really is quite easy to use,
Unlink () function Delete file, mkdir () function Create directory, rmdir () function Delete directory
Copy CodeThe code is as follows:
Unlink () function Use instance
To delete a file using the Unlink function
$filename = "Data.txt";
The following code is the online most people give the time stamp reality, this one can only say that a look at the current date, but not a timestamp, do not have to explain it!
Copy CodeThe code is as follows:
$now = Mktime (0,0,0,date ("M"), Date (
Introduced
PHP is a very amazing language. It's strong enough (The biggest blog (WordPress) core language), it's broad enough (running on the biggest social networking site on Facebook), it's simple enough (as a beginner's preferred entry language).
With this applet, phper do not have to manually delete the directory files on the computer, in the practice of PHP directory file operation can use this function, on this basis can also increase the Browse folder directory, and then delete.
Code
I have seen the source of Phpcms, discuz, so there may be a lack of innovation, but the principle is mostly connected, but the details may be slightly different processing.
To get to the point, let's start with the concrete implementation process.
1.
Added in Head.htm, that is, add "$stime =microtime (True) in the default template; Gets the time that the program started executing "
Copy CodeThe code is as follows:
$stime=microtime(true);
An example of comparison
Example one:
Copy CodeThe code is as follows:
$var 1 = 1;
function Test () {
unset ($GLOBALS [' var1 ']);
}
Test ();
echo $var 1;
?>
Because $var1 was removed, nothing was printed.
Example two:
Copy CodeThe code is as
PHP download files, such as txt files.The effect is that the pop-up browser comes with the download box and the Save As action appears. Sometimes there are memory overflows and timeouts.
If the timeout is set
set_time_limit (0);If there is a memory
The code looks like this:
Copy CodeThe code is as follows:
Class Gifmerge {
var $ver = ' 1.1 ';
var $dly = 50;
var $mod = ' C_file ';
var $first = true;
var $use _loop = false;
var $transparent = false;
var $use _global_in = false;
var $x = 0;
var $
I believe a lot of friends do not know, you can call PHP's built-in function in the Smarty template, let's take a look at its usage.
Template writing:{' param1 ' |functionname: ' param2 ': ' Param3 '}PHP function Prototypes:echo functionname ('
The following is a personal summary of the PHP file operation function. Of course, this is only part of it, and there are a lot of them that I didn't list.
First, the analytic path:
1 Get the file name:
BaseName ();
Give a string containing a full
The following is a simple message processing server that is implemented via the socket Extension module of PHP: Binds to a local port, listens for client connections, receives data and forwards to all clients other than the sender
socket_server.php
Haven't written a post for a long time. have been busy with new projects. Recently, do the verification Code program, has always wanted to do a simple and generous, automatic identification is more difficult. Through these times to collate the
This is the implementation of the Select default selection for the extended yibing
Copy CodeThe code is as follows:
Value= "1" > Residences
Value= "2" > Office
Value= "3" > Business Room
Value= "4" > Plant
Value= "5" >
Mb_convert_encoding This function is used to convert the encoding. It turns out that the concept of program coding is not understood, but it seems to be a bit enlightened now.
However, there is generally no coding problem in English, only the
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