This article summarizes some of the functions commonly used in PHP application development, these functions have character operation, file operation and some other operations, share for everyone reference. Specifically as follows:
1, PHP encryption
This article is an example of how PHP uses Google Maps. Share to everyone for your reference. Specifically as follows:
The PHP code is as follows:
Copy Code code as follows:
function selected ($param, $value) {
if ($param = = $value)
Copy Code code as follows:
$a = 3;
$b = 6;
if ($a =5| | $b =7) {
$a + +;
$b + +;
}
Var_dump ($a, $b);
Trap A
$a=5, $b = 7 as the $a==5, $b ==7
Error Result: 3,6
Trap Two
The precedence of the operator that the $a=5
It is obvious that file_exists is affected by the ASP, because the ASP not only has FileExists and folderexists,driverexists, then what is the meaning of file_exists in PHP?
PHP file_exists = is_dir + is_file
It can determine whether a file
1. What is the namespace in PHP?
What is a namespace? "In the broadest sense, namespaces are a way of encapsulating things." This abstract concept can be seen in many places. For example, in the operating system the directory is used to group
In fact, this is very simple, but I always want to use the Ipv6-test API to do a get user IP address things ... Unfortunately, JSON gets only the IP of the native server. Forget it, do not study, not to mention that the widget is also very useful.
With the popularity of mobile devices, the site will also usher in more and more mobile devices access. Used to adapt to the PC page, often unfriendly to mobile phone users, then sometimes, we need to determine whether the user to access the phone,
1 in the SQL statement you can add a restriction condition: Left (text,20) only the first 20 words of the text;
2 can be used as pagination using limit FromRecord, recordnum, for example, limit 0,30 indicates that 30 records are traversed from the
/**
* $splitChar Field Separator
* $file data file filename
* $table database table name
* $conn Database connection
* $fields the corresponding column name of the data
* $insertType insert operation type, including Insert,replace
*/
Copy
The example in this article describes the Phpfastcache usage of the PHP cache integration Library. Share to everyone for your reference. The specific analysis is as follows:
Phpfastcache is an open source PHP cache that provides a simple PHP file
The Define () function defines a constant.The purpose of the Define () function is to define a constant.Constants are much like variables, except for the following differences:constants [constant] have a lot in common with variables [variable], so
Today looked at the WordPress code, there are some rare php substitution syntax,
Copy Code code as follows:
→ ', ' Thebox ')?>
' '. __ (' pages: ', ' Thebox '), ' after ' => ' ));?>
What does the colon and
This example summarizes the common PHP data file cache classes. Share to everyone for your reference. The specific analysis is as follows:
The practice of data file caching we often have PHP file caching and using Memcache to cache data, below I
From the PHP 5 version, the class in PHP can use the Magic method. The rules that start with two underscores (__) are reserved as magic methods, so it is recommended that you do not start with a function name unless you are trying to overload an
This article describes a number of PHP files and image upload methods. Share to everyone for your reference. The implementation methods are as follows:
Multiple file uploads on the basis of a single file upload using traversal array to traverse the
The PHP string function includes the lookup character position function, extracts the child character function, replaces the string, the character length, compares the character function, splits the array character, removes the space and so on.
The
As shown below:
Copy Code code as follows:
//=============================== time and date ===============================Y returns the last two digits of the year, Y-year four-digit, M-month number, M-month English. D month number, D
This article describes the use of Php curl to imitate the user login Sina Weibo microblogging method. Share to everyone for your reference. The implementation methods are as follows:
Now use PHP to do imitation user login we will use the PHP curl
Use the PHP implementation to calculate the number of years, months, weeks, and days for two date intervals:
Copy Code code as follows:
function format ($a, $b) {
Check two date size, the default is small after the big, if the former
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