1. Defining ConstantsDefine ("CONSTANT", "Hello world.");
Constants can only contain scalar data (boolean,integer,float and string).
When calling a constant, simply use the name to get the value of the constant, not the "$" symbol, such as: Echo
Memcache Data Consistency problem: When the MySQL data changes, if not timely and effectively clean out the outdated data, will cause data inconsistency. This is not desirable in the Web2.0 era, which emphasizes immediacy.
The avalanche effect
The example in this article describes the calendar program that PHP implements. Share to everyone for your reference. as follows:
Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat ');
$Weekday _count = count ($Weekday);
$daynum = 0;
$space = " ";
$
Last Updated: 2011/04/02
1. Use the list to achieve a specific segment value after getting explode:
List (, $mid) = explode ('; ', $string);
2. Use NULL = = to replace Is_null:
Is_null and NULL = = are exactly the same effect, but save a function
The examples in this article describe how PHP accurately obtains file MIME types. Share to everyone for your reference. The implementation method is as follows:
' application/postscript ', ' eps ' => ' application/post Script ', ' exe ' => '
Online Demo Address: http://tools.jb51.net/tools/cs.php
Copy Code code as follows:
function Zhuanhuan () {
$urlodd =explode ('//', $_get["url"],2);//The link is divided into 2 paragraphs,//front is the first paragraph, followed by the
Cosmetic mode (decorator pattern), also known as the decorator mode, is a design pattern that dynamically adds new behavior to a class in the field of object-oriented programming. In terms of functionality, cosmetic patterns are more flexible than
This article illustrates how PHP implements resizing pictures on the server side. Share to everyone for your reference. The specific analysis is as follows:
Resizing a picture on the server side can be a lot more beneficial than a browser's
I used more than 3 years of Linux desktop, is very uncomfortable, mainly the experience of various software is not uniform, too fragmented, too many choices make people have no choice.And back to Windows, it's even worse, using the *nix toolset
Before looking at some PHP framework source code, very strange in the file contains, will use DirName (__file__) to patchwork file path, do not know what the benefits, then finally found the reason.
Let's look at a simple example:
There are a,b,c
1. Make a simple upload file first
Copy Code code as follows:
Enctype= "Multipart/form-data" >
Filename:
Copy Code code as follows:
if ($_files["file" ["Size"] {
if
This example describes how PHP uses the GD library to create thumbnail images of pictures. Share to everyone for your reference. The specific analysis is as follows:
Static HTML code for uploading pages:
file upload
file upload
To get the remote files using PHP curl, the code is as follows:
Copy Code code as follows:
?
$ghurl = Isset ($_get[' id ')? $_get[' id ']: ' http://www.baidu.com/';
PHP Access
function getcontents ($url) {
$header = Array
The UUID full name is the universally unique identifier, which is an identifier that can be generated using any computer, without requiring a central database for management, which guarantees that there is little chance of duplication. The range of
Today I learned about arrays, which is one of the more important ways to use PHP data. PHP's Array function is numerous, below is my study summary, takes this to remember, facilitates later ...
one, array definition:The definition of an array is
This article illustrates how PHP randomly reads files from a folder. Share to everyone for your reference. The implementation method is as follows:
function Randomfile ($folder = ', $extensions = '. * ') {//fix path: $folder = Trim ($folder); $
On the form batch submission strategy in program developmentMany times a form too many fields, how to efficiently get the form field, but also for how to refresh the development of efficiency and unity?
For example, if a system has 26 fields, then
First, Mac computer phpstorm shortcut keys
Command + a Select allCommand + C replicationCommand + V PasteCommand + z UndoCommand + K code SearchCommand + L Enter line number jump to a lineCommand + o View the structure of a classCommand
checkdnsrr-DNS traffic checks for the specified host (domain name) or IP addresscloselog-Turn off System log linksdefine_syslog_variables-initialization of all syslog-related variablesDNS_CHECK_RECORD-CHECKDNSRR AliasDNS_GET_MX-GETMXRR
A, PHP floating point accuracy loss problem
Let's look at the following code:
Copy Code code as follows:
$f = 0.57;
Echo intval ($f * 100); 56
The result may be a little surprising to you, PHP follows IEEE 754
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