PHP If ... Else Simple Tutorial
, if ElseIf's reports and other PHP are used to perform different actions, depending on the conditions.-------------------------------------------------- ------------------------------Conditional statementOften
PHP is a server-side scripting language that is easy to learn and use. With minimal programming knowledge you can use PHP to create a truly interactive web site. This tutorial does not want you to fully understand the language, only to enable you to
Review Regular expressions are a powerful tool that can be used for pattern matching and substitution. Regular expressions allow the user to build a matching pattern by using a series of extraordinary characters, then compare the matching pattern
086-area code-number-Ext^086-[1-9][0-9]{1,4}-[1-9][0-9]{4,7}-[0-9]{3,4}$
2G's cell phone number is almost all 13.
The code is as follows
Copy Code
$mobilephone =trim ($_post["Smmobilephone"]);Regular verification of
Examples are as follows.
Suppose your text contains nested parentheses with the correct pairing. The depth of the bracket can be an infinite layer. You want to capture such a bracket group.
Forgive me for spoilers, the standard answer is this:
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
php-5.2.14 version
The code is as follows
Copy Code
./configure–prefix=/usr/local/php-5.2.14–with-config-file-path=/usr/local/php-5.2.14/etc–with-gd–with-iconv–
Note: The MYSQLI expansion Library is designed to work in conjunction with MySQL 4.1.3 or later
The first two days a site to transfer over, because there are problems to my database, I did not carefully deal with this site. Today the database is
This evening: 19:30 points, this troubled me for a long time to finally solve the problem, the principle is finally clear, in short, the use of sudo to give Apache user root executive authority, the following record:
Using PHP to execute a shell
1. When a user accesses the SERVER, use the PHP Super global variable $ _ SERVER array field ['http _ USER_AGENT '] to obtain all information of the user The code is as follows:Copy code Echo $ _ SERVER ['http _ USER_AGENT '];?> Output
Const attributesThe field defined with the const attribute is a constant. Constants in the class are similar to static variables. The difference is that the value of a constant cannot be changed once it is assigned a value.The const definition
Simple reference to fopen functionsThe fopen () function opens a file or URL.If opening fails, this function returns FALSE.SyntaxFopen (filename, mode, include_path, context)Instance 1Example of creating a file: The code is as follows:Copy code
Readfile(PHP 4 and PHP 5)Readfile-output a fileDescriptionInternational readfile (string $ file name [, Boolean $ use_include_path = false [, resource $ background])Read the file and write it to the output buffer.ParametersFile nameThe file is
If the php-cgi process is insufficient, the php execution time is long, or the php-cgi process is dead, a 502 error will occur.1). Long php execution timeIf the server performance is good enough and the bandwidth resources are sufficient, you can
Some time ago, I encountered a "URL plus cause error" BUG. The cause of this bug is that I used the urlencode function in the URL, which converts spaces to the plus signs, in this case, the URL parsing error occurs, and the space can be parsed only
Code The code is as follows:Copy code Header ("Cache-Control: no-cache, must-revalidate, no-store"); // This no-store is valid in Firefox after it is added.Header ("Pragma: no-cache ");Header ("Expires:-1 "); This page is no longer cached, and
Php. iniFile_uploads = on; whether to allow file upload over HTTP. ON is enabled by default.Upload_tmp_dir; upload the file to the place where the temporary file is stored on the server. If it is not specified, the default temporary folder will be
Obtaining the date and time is also frequently used in website design. Php provides the date () time function to implement this function. The structure is as follows:Instance: The code is as follows:Copy code Echo date ("F j, Y, g: I a"). "&
Let me introduce myself again.I was a newbie. At that time, I learned php purely to cope with the leadership. Let's make a statistical chart. I originally learned asp and suddenly changed the line. However, php is really powerful, well, I can't
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