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!==
1, the use of ++i (A=++i, i=2 as an example)
First add the I value by 1 (that is, i=i+1), and then assign the variable a (that is, a=i),
The final a value is equal to 3, and the I value equals 3.
So a=++i is equivalent to i=i+1, a=i
2, the use
To reduce repetitive code, it is often necessary to include heade and footer, and the most common operation we use is require or reqire_once code, but we can implement this inclusion in a different way, write a function such as Printheader, as shown
1, the software structure development process in 3 stages:
Model1 mode, Model2 mode, MVC pattern
The most important feature of 1>MODEL1 is that there is no layered concept, which means that the interface
And business logic are handled in a single
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
Problem Description: Sometimes need in two or three database tables, through the relevant keywords, query to obtain the required recordset, with a general SQL query statement is not achievable, through access to the cross-Library query function.
This article describes the PHP linear table in the stack and the use of the stack. Share to everyone for your reference. Specifically as follows:
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
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
For weakly typed languages, PHP function overloads are not as common as oop. Weak types are inherently indistinguishable, so they cannot be implemented through these. However, it is possible to implement a simple pseudo overload in the following
The data is put into the database and taken out to display when the page needs to be noticed warehousing $str =addslashes ($STR); $sql = INSERT INTO ' tab ' (' Content ') VALUES (' $str '); When out of the library $str =stripslashes
Floor the whole grammar format: float floor (float value)returns the next integer not more than value, rounding out the decimal part of value. The type returned by floor () is still float, because the float value is usually larger than the
This article to share is the use of PHP to achieve a lot of search dog case code, very simple and practical, there is a need for small partners can refer to.
PHP Batch Search Sogou Sogou rank, very good, mainly using the PHP file_get_contents ()
Q 1: Why "APACHE" appears. Exe:cannot determine local host name. "?
Answer 1:
Because the Windows version of Apache does not specify servername by default, the Run-time error occurs.
The solution is to modify the httpd.conf in the Conf directory
First, prevent form deformation
Add in the corresponding Table tab
Style= "table-layout:fixed; Word-break:break-all "
Second, shielding HTML code
Replace the words "" in the contents of the message with can be.
Third, replace hard return
That
When PHP is running as an Apache module, the Apache security takes the lead, so if configured correctly, PHP should be a very secure environment, but if PHP is running in CGI, it's not so safe.The actions mentioned in this article apply to both UNIX
This article mainly introduced the PHP.ini Security Configuration Detection Tool PCC Brief Introduction, this tool is very practical, may detect the PHP configuration file to have the security hidden trouble, and proposes the corresponding
This article describes the method of Php+ajax real-time automatic detection of whether the network. Share to everyone for your reference. The implementation methods are as follows:
HTML Section Code:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
This example describes how PHP uses a for statement to output triangles. 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
'; } Dis (a);?>
I hope this
/*____ Generate HTML file ________beign__________*/
if ($make _html)
{
$buffer = Ob_get_flush ();
if ($go _html)//whether directly to the HTML file display or PHP read content output (0:php read content Output 1: Direct turn)
{
/*__ handles 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