_ File _ is the complete path and file name of the returned file. If it is used in a include file, the include file name is returned. Starting from PhP 4.0.2, __file _ always contains an absolute path, while earlier versions sometimes contain a
1. Why does PHP require asynchronous operations?
In general, PHP is applicable to web page display tasks that are time-consuming. If you want to perform time-consuming operations such as resize images, big data import, Batch Sending of EDM and SMS,
You can see a question on the Internet:
The result of Array ("A") + array ("B") is ___
A. Array ("A", "B ")B. Array ("B", "")C. Array ("B ")D. Array ("")
Answer: d
Why does the result remain unchanged when the PHP arrays are added?
Because they
1, this
1. to use this, you must be in a situation like this. Otherwise, it will report an error: Fatal error: Using $ this when not in object context.2. this can call methods and attributes in this class, or call methods and attributes that can be
I. Class Document Description
Copy codeThe Code is as follows: class Image_Tool {
/**
* Construct the Image_Tool object
* @ Param string | array $ img_data
* $ Img_data can be the image path
*/
Function _ construct ($ img_data = "");
/*** Add text
The basic operation of insert sorting is to insert a data to an ordered data that has already been sorted, so as to get a new ordered data with a number plus one.
Algorithm Description:
The sequence starts with the first element, which can be
First, explain separately,
Trim filters both ends of a string,Rtrim filters the tail of the string, = chop ()Ltrim filters the string header.
You can only use str_replace to filter the middle keys in a string.For example,
PHP code
Copy codeThe
When building a website, programmers prefer the PHP language. We are still familiar with PHP. Next we will introduce the PHP recursive algorithm. PHP, an abbreviated name for nesting, is the abbreviation of the English Super Text preprocessing
In the actual PHP encoding, PHP recursive calls are encountered when we need to implement the multi-element array replacement function. So what is the specific usage? The following is a code example to illustrate how to implement this function.
Remember, you can use it directly when you need to use it in the future, or you can click here to view this article.
Copy codeThe Code is as follows: // Method 1:
Function extend_1 ($ file_name)
{
$ Retval = "";
$ Pt = strrpos ($ file_name ,".")
Algorithm principle
If P is used to represent the full arrangement of n elements, and Pi is used to represent the full arrangement of n elements that do not contain element I, (I) pi indicates the arrangement of Pi with the prefix I. The full
The basic logic is the same as that of. net. It is to replace the object class with an array for configuration. The logic is simple, and the paging html is spliced according to the condition judgment.
It has the following simple functions:
1:
First, let's take a look at the definitions of the two methods:
Function prototype: array split (string $ pattern, string $ string [, int $ limit])
Function prototype: array explode (string $ separator, string $ string [, int $ limit])
There is
Copy codeThe Code is as follows: $ A = 3;
$ B = 6;
If ($ a = 5 | $ B = 7 ){
$ A ++;
$ B ++;
}
Var_dump ($ a, $ B );
Trap 1
Consider $ a = 5 and $ B = 7 as $ a = 5 and $ B = 7.Error result: 3, 6
Trap 2
Operator priority. $ a = 5 is assigned
According to the difference between file_exists and is_file and is_dir in PHP, we can basically understand that file_exists = is_dir + is_file in PHP.
Write a program to verify it:
Execute 1000 times, respectively, and record the time
Obviously, file_exists is affected by asp, because asp not only has fileExists but also folderExists and driverExists. What does file_exists in PHP mean?
File_exists = is_dir + is_file in PHP
It can determine whether a file exists and whether a
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