Copy codeThe Code is as follows: Function deldir ($ dir ){
// Delete the files in the directory first:
$ Dh = opendir ($ dir );
While ($ file = readdir ($ dh )){
If ($ file! = "." & $ File! = ".."){
$ Fullpath = $ dir. "/". $ file;
If (! Is_dir ($
What is an array?
When using PHP for development, you need to create many similar variables either early or late.
Without many similar variables, you can store data as elements in an array.
All elements in the array have their own IDs, so they can
In http transmission text, it is required that the header and content must be in the following order: the header must be in the front content, and the header must be in the format of "keyword: value \ n.
1. If there is output content before the
For those who want to do web security, it is best to learn it. But what we want is not fish but fish. In China, a variety of php 1.0 and 2.0 programs have sprung up. However, we are all concerned about some famous cms, forum, and blog programs, few
I. No proxy server is used:
REMOTE_ADDR = your IP addressHTTP_VIA = no value or no displayHTTP_X_FORWARDED_FOR = no value or no display
Ii. Transparent proxy server: Transparent ProxiesREMOTE_ADDR = IP address of the last Proxy ServerHTTP_VIA =
1. php
Copy codeThe Code is as follows:
Basic Information 1:
Basic Information 2:
2. phpCopy codeThe Code is as follows: Product name: Product price: Product Model: "/> "/>
3. phpCopy codeThe Code is as follows: Other information 1: Other
Include performance
Copy codeThe Code is as follows: include ('include. php ');
Of course, this method is not wrong, but it is slightly less efficient than the following method:
Copy codeThe Code is as follows: include (realpath (dirname (_ FILE _).
Difference between SESSION and COOKIE:
Session stores the information on the server. After receiving the unique SESSION_ID, the server obtains the relevant data based on the ID and then transmits the information to the client (browser ).
Cookie
File processing functions
1. File Operations.Open the file:
When a specified file is opened, the corresponding object is returned. If the specified file does not exist, the file may be automatically created.
Resource fopen (string filename, string
First look at a js Function
Copy codeThe Code is as follows: function jsontest ()
{
Var json = [{'username': 'crystal ', 'userage': '20'}, {'username': 'candy', 'userage ': '24'}];
Alert (json [1]. username );
Var json2 = [['crystal ', '20'],
Php contains a system method that can call system commands.
Create a script (like/root/reboot_server.sh) and restart it.
Copy codeThe Code is as follows :#! /Bin/bash
Reboot
Grant him another permission of 4755Chown root:
1. You can add restrictions in SQL statements: left (text, 20) only takes the first 20 words of text;
2. limit fromRecord and RecordNum can be used as pages. For example, limit indicates that 30 records are traversed from the first record;
3. join
Functions used:
Str_split: splits the string into arrays. A similar function explode () Splits strings into arrays. Array_count_values: used to count the number of occurrences of all values in the array.
Arsort: sorts arrays in reverse order and
(1) Enable the php security mode
The security mode of php is a very important embedded security mechanism that can control some php functions, such as system (),At the same time, many file operation functions are subject to permission control, and
1. Factory Model
The main function is to reduce coupling.
Copy codeThe Code is as follows: abstract class Operation {
Abstract public function getValue ($ num1, $ num2 );
Public function getAttr (){
Return 1;
}
}
Class Add extends Operation {
Public
Copy codeThe Code is as follows: Class Crypt3Des
{
Private $ key = "";
Private $ iv = "";
/**
* Construct and pass two keys and IV that have been base64_encode
*
* @ Param string $ key
* @ Param string $ iv
*/
Function _ construct ($ key, $ iv)
{
If
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