PHP, if the declaration is very similar to other programming languages using the IF statement, but for those who are unfamiliar with it, the pictures are as follows:Think about your decision to make before you go to bed. If you have to do this the
PHP Microtime () Function Example Tutorial
Microtime () Definition and usageThe Microtime () function returns the current UNIX timestamp and microseconds.
Grammar
Microtime (Get_as_float)Parameter Description get_as_float Optional. When set to
Tutorials and methods for using PHP array_change_key_case () functions.
Definitions and usageThe Array_change_key_case () function returns the key names of all arrays of an array, lowercase or uppercase.
GrammarArray_change_key_case
How to use the PHP mail () function
PHP's Mail () function is used to send e-mail messages within the script.
Grammar
Mail (to,subject,message,headers,parameters)
Parameter descriptionRequired. Specify receiver/Receive emailmust be
PHP $_post
The $_post variable is used to collect value in a form and method = "POST".In the $_post variableThe $_post variable is a variable whose array name and value emit an HTTP POST method.The $_post variable is used to collect value in a
As you know, PHP is a PHP is a server based on the creation of Dynamic Web site scripting language, you can use PHP and HTML to build the site home page. When the user opens the PHP page, the server executes the PHP commands and sends the results to
Lamp's Overviewlinux= operating system apache= foreign server mysql= database php= Run script program for the backend serverLamp is an abbreviation for a group of Open-source software that is often used to build dynamic Web sites or servers,
It is said that php5.4 is faster than the previous versions of PHP, so it is necessary to install to test (domestic more popular PHP programs such as Discuz and so on php5.4 support seems not too friendly, so webmaster friends or to be cautious
1. Time conversion function in phpStrtotimeThe strtotime () function parses the date and time descriptions of any English text into Unix timestamps.SyntaxStrtotime (time, now)Example The code is as follows:Copy code Strtotime ("today ") DateThe
Let's take an example today: The code is as follows:Copy code ';Function she ($ a, $ B, $ c){Return array ($ c, $ B, $ );}List ($ x, $ y, $ z) = she (2, 3, 4 );Echo '$ x ='. $ x. '$ y ='. $ y. '$ z ='. $ z;?>The execution result is as
String urlencode (string str)Returns a string -_. all other non-alphanumeric characters will be replaced with a semicolon (%) followed by two hexadecimal numbers, and spaces will be encoded as the plus sign (+ ).Example 1: Difference between
The $ _ FILES array contains the following content:$ _ FILES ['myfile'] ['name'] original name of the client file$ _ FILES ['myfile'] ['type'] MIME type of the file, which must be supported by the browser, for example, "image/gif"$ _ FILES ['myfile']
We can use meta tag and header in the PHP program to control the HTML page. For example: The code is as follows:Copy code Header ('cache-Control: max-age = 86400, must-revalidate'); // 24 hoursHeader ('last-Modified: '. gmdate ('d, d m y h: I: s'
The code is as follows:Copy code Function sendHeader ($ num, $ rtarr = null){ Static $ sapi = null;If ($ sapi = null){ $ Sapi = php_sapi_name ();} Return $ sapi ++; When reading the PW source code, I found that the setHeader ()
I have been very busy recently. I have encountered a manual activity and need to download some remote images. There are more than one hundred images in total. If I save them manually, it will take too much time, so I Googled the Internet, find the
Can the HTML code output by the server be compressed?The following is a function for compressing HTML: The code is as follows: Copy code Function wpjam_minify_html ($ html ){
Optional ziparchive parameters1. ZipArchive: addEmptyDirAdd a new file directory2. ZipArchive: addFileAdd the file to the specified zip package.3. ZipArchive: addFromStringAdd the content to the added file at the same time.4. ZipArchive:
The code is as follows:Copy code // Obtain the file directory list. This method returns an array.Function getDir ($ dir = "){$ Dir = empty ($ dir )? Getcwd (): $ dir;$ DirArray [] = NULL;If (false! = ($ Handle = opendir ($ dir ))){$ I = 0;While
Example 1:Read/write files The code is as follows:Copy code $ Filename = 'txt/write.txt ';// Define the content to be written$ Content = "Mr. Li 36 Shandong nr Mr. Wang 49 Hunan nr Mr. Sun 40 Hebei ";// Use the is_writable () function to
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