Since PHP 5, you can easily add & before $ value to modify the elements of the array. This method will assign values by reference instead of copying a value.
CopyCodeThe Code is as follows: $ Arr = array (1, 2, 3, 4 );
Foreach ($ arr as & $ value )
Copy codeThe Code is as follows:
// ====================================== Define redirect () start = ///**
* Defines the redirect () Jump function, which is used to jump to the specified page as required after user operations
*
* @ Param
The following example shows the differences between the three functions. var_dump and var_export are less useful, but they are similar. So you can see:
Copy codeThe Code is as follows: $ A = array (32,322,343, 32,232,232 3, array (32 ));
$ B = 1234;
Now we have such HTML file testjsonp.html under the domain name www.test.com:
Copy codeThe Code is as follows:
Untitled Page
Note: To truly run the above Code, you may need jquery files, you can change to the file path of jquery in your
Copy codeThe Code is as follows:
// Define the size of the thumbnail.$ PicSize = array (
'1970 _ 100' => 1,
'2017 _ 000000' => 1
);
$ ImagePath = "../image /";
Function parseUrl ($ url ){
Preg_match ("/(? P [\ w \ d] +) _ w (? P \ d +) _ h (? P \
I use winXP for local development, but the uploaded server is linux. I always need to change the configuration file before each upload, and there are other things,
Now, by determining the type of the current server to determine what program to
Before using the database, we 'd better automatically connect the database: config/autoload. php automatically loads $ autoload ['libraries'] = array ('database ');Some common functions
Select data$ This-> db-> select ();You can write the SELECT
SQL Injection:
Under normal circumstances:
Delete. php? Id = 3;$ SQL = 'delete from news where id = '. $ _ GET ['id'];
Malicious situation:
Delete. php? Id = 3 or 1;$ SQL = 'delete from news where id = 3 or 1'; ------- after this operation, all
1. To use the curl_setopt function, you must compile the curl component on the server. For how to install and compile this component, go to google to search.
Ii. Explanation of the php help document of curl_setoptBool curl_setopt (int ch, string
During PHP running, different prompts are given for errors with different severity levels.
Eg: When $ a is not declared, it is directly added. The value is NULL. When it is added, it is regarded as 0. However, it prompts NOTICE, that is, attention.
After uploading images, it was difficult to get rid of the problem. Later I found it was a problem with the php parameter configuration.
The following summarizes the php parameters related to file upload ~
All these parameters are set in php. ini.
B/s: web programs based on browser and server architecture
C/s: qq svn client + server
Simple text line-based protocol: RedisMemcache
Differences: All data is stored. memcache is saved directly to the memory, redis is saved to the memory, closed,
First, let's talk about the differences between \ r and \ n.The origins and differences between Carriage Return and Line Feed.Before the computer appeared, there was a kind of thing called Teletype Model 33, which also came from the tty concept in
Method 1Using the YII system to generate a view is a little troublesome and it is easier to use smarty. Try to add the smarty template.
Copy codeThe Code is as follows: date_default_timezone_set ("PRC ");
Class PlaceController extends CController
The responsibility chain mode aims to organize an object chain to process a request such as a method call.
When ConcreteHandler (a specific Handler) does not know how to satisfy the request from the Client, or does not aim at this, it delegates it
The define () function defines a constant.The define () function defines a constant.
Constants are much like variables, except t for the following differences:Constants [constant] and variables [variable] have many similarities, so they are easy to
Constants can be interpreted as variables with unchanged values. After a constant value is defined, it cannot be changed anywhere in the script. A constant consists of letters, underscores, and numbers, but a number cannot be the first letter.Use
Similar to basic identity authentication, you can use PHP Web pages to process HTTP request header fields to match digest authentication information. For example, the following code uses the header () function to require the client to use Digest for
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