First of all, I would like to introduce PHP to execute the Linux system commands several basic functions. For a long time I have been confused about the specific usage differences of the following functions.system functionDescription: Execute
The example in this article describes the use of PHP to get folder size functions. Share to everyone for your reference. Specifically as follows:
?
Get folder Size
function Getdirsize ($dir)
{
$handle = Opendir ($dir);
while (false!==
First, embed PHP code in javascript
If JavaScript is included in the JS file, then the JS file can also write directly PHP code, except that the JS file is the extension to be converted to PHP, such as:
Default values for JavaScript function
PHP output includes the Web page display and pop-up information box content.Garbled generally is the browser to choose the display code and the encoding of the Web page is caused by different, although web surfers can manually select the code to
We can use the header to control the HTML page using the META tag and the PHP program. For example:
The code is as follows
Header (' cache-control:max-age=86400, Must-revalidate ');//24 hour
Header (' last-modified: '. Gmdate (' d, D M Y h:i:s ').
This article mainly introduced the PHP merge array + number and array_merge difference, the PHP array fusion generally has two kinds of practices, one is to use the plus sign directly to add, the other is to use the Array_merge function to add, the
This example describes the PHP sort algorithm class. Share to everyone for your reference. Specifically as follows:
PHP implementation of the four sort algorithms:
1 The basic idea of the insertion sort (insertion sort) is:
Each time a record to
The general function of converting a Chinese character to Unicode does not depend on any library or any other custom function, but conditionally: this file and the input parameters of the function should be encoded with utf-8, otherwise the function
This article to share 2 PHP using mb_xxx method to achieve the Chinese character segmentation method, its basic ideas are similar, the need for small partners can refer to.
Str_split does not support Chinese and uses the MB_XX function to implement
This article mainly introduces the PHP implementation window platform CHECKDNSRR function, PHP's own CHECKDNSRR function only in the Linux platform is effective, this article simulates a window can be used under the CHECKDNSRR function, the need for
The example in this article describes the PHP implementation to replace the callback with the regular expression of the content tag. Share to everyone for your reference. The implementation methods are as follows:
?
1 2 3 4 5 6 7 8 9 10
This paper illustrates the method of random ordering of PHP arrays. Share to everyone for your reference. The implementation methods are as follows:
1 2 3 4 5
The results of the operation are as follows:
1 2 3
This article illustrates the method of Smarty region loops in PHP. Share to everyone for your reference. The implementation methods are as follows:
1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15
smarty test { foreach Key=key1 item=item1
We can use the news system to store news, we can add to the news, delete and other operations, so as to reduce the workload of everyone, why not experiment.
first, create a table.
CREATE TABLE News (n_id Int (255) NOT NULL auto_increment,N_date
The knowledge of this article: 1, JSON data format introduction, 2, the data encoded into JSON format, 3, the JSON data decoding, and operation, the need for small partners can refer to.
JSON, the full name is the JavaScript Object notation. It is
This article mainly introduces the PHP file operation method Summary of the relevant information, the need for friends can refer to the
To write data in the file:
?
1 2 3 4 5 6 7 8 9 10 11 12 13-14
You can see "OK" on
In order to improve the speed of the Web site, we often use to generate a static way to achieve, so that the site is really a lot of access to improve the speed. But there are some limitations to the timing generation, if you have a stand-alone
This article mainly introduces the Linux system on the server to hide the version of the PHP method, to help prevent the attacker against the detailed version of PHP attacks launched by the attack, the need for friends can refer to the
In general,
This article mainly introduces the PHP loop table to achieve a row of two columns to display the method, this article directly to the implementation of code, the emphasis is on the use of complementary methods, the need for friends can refer to 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