First, with the HTTP header information
That is, using the header function of PHP. The function of the header function in PHP is to send the browser a control instruction that is supposed to pass through the Web server as specified by the HTTP
At the end of last year, a variety of website account information of the database leakage, it is to force Ah, the opportunity to download a few databases, prepare to learn the data analysis to analyze these account information. Although these data
Introduction
For PHP performance problems, the most talked about is the __autoload () method, many people mention that this method has a significant impact on performance. Others say that opcode can also affect the __autoload () method, so I made
@access
Scope of Use: Class,function,var,define,module
The tag is used to indicate access rights for the keyword: private, public, or proteced
@author
Specify the author
@copyright
Scope of Use: Class,function,var,define,module,use
Specify copyright
Copy CodeThe code is as follows:
$foo = ' Bob '; Assign ' Bob ' to $foo
$bar = & $foo; by $bar Reference $foo
echo $foo. '
';
$bar = "My name is $bar"; modifying $bar variables
echo $bar. '
';
echo $foo. '
'; The value of the $foo is also modified
?
Copy CodeThe code is as follows:
Echo ' Begin time: '. $begin =microtime (false). '
';//begin to count time
$array =array ();
for ($i =1; $i $array [$i]= $i;
}
/*
$arr = $array;//copy copy and print total time 0.02
foreach ($arr as $ar) {
echo $ar.
In PHP, arrays are divided into two categories: numeric indexed arrays and associative arrays.
Where the numeric index array is the same as the array in the C language, the subscript is for 0,1,2 ...
Associative array subscripts may be of any type,
Copy CodeThe code is as follows:
$name = "admin";//kkkk
$BB = ' 234 ';
$db = 4561321;
$KKK = "admin";
?>
function definition:
Profile Data Value acquisition: function GetConfig ($file, $ini, $type = "string")
Profile Data Item Update: function
I have written a registry class before, but that one cannot be registered with multiple classes, and the following arrays are used to store the class.
Copy CodeThe code is as follows:
Basic class
Class WebSite {//a very simple base class
Private
The usage of __autoload () is no longer said, and has previously been mentioned in my web development notes. PHP __autoload function (Automatic loading class file), the original address: http://www.jb51.net/article/29625.htm.
Say,
The first method: a function that comes with PHP
/*
Trim removes a string at both ends of a space,
RTrim is to remove a string to the right of the space,
LTrim is to remove the left space of a string.
*/
?>
Echo Trim ("space"). "
";
echo RTrim
In the use of the time, you have to generate a summary of the content strip_tags (), of course, you can also add strip_tags () directly into the function, I did not engage, add it myself. Here is the function:
Copy CodeThe code is as
Problem
The company has a framework is based on Smarty write, I am responsible for the upgrade of PHP, maintenance personnel to the new environment after the test staff to ask me to make frequent errors (error: Prompted to find the file).
I traced
It only takes two variables to achieve half of the success:
Number of records to display per page $pagesize
The total amount of data in the table $rowCount
With the above two variables, we can draw a total of a few pages $pagecount
Then, with a for
if ($_post[loginsubmit]!=) {//Determine if the login button is clicked
$SB =user:.$_post[username].--passwd:.$_post[password].--ip:. $HTTP _server_vars[remote_addr].--. date (Y-m-d H:i:s) . RN; Connect the value of the post received to the variable $
Copy CodeThe code is as follows:
AuthName "Yousite Website Coming Soon ..."//If you want to add access to your website
AuthType Basic
AuthUserFile d:/xxx/.htpasswd #如果你想设置密码访问 How to build. HTPASSWD can access
A field is a property that describes the aspects of a class.
A field is a property that is used to describe an aspect of a class. It's very similar to the usual PHP variables, but there are some subtle differences, and this section describes the
Algorithm thinking: Each of the numbers as a separate mathematical expression, the expression with a punctuation group to synthesize a new expression, altogether 4 times, all the combinations between expressions can be implemented by recursion.
The
Copy CodeThe code is as follows:
/**
* PHP Age Calculation function
*
* Parameters support array parameter and standard Mysql date type parameter
* Params sample
* --------------------------------------------------
$BIRTHARR = Array (
' Year ' = ' 2
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