A switch statement is like a series of if statements to the same expression. In many times, you want to compare the same variable (or expression) with many different values, and perform different pieces of the program based on different comparison
1. Arithmetic operators
The code is as follows
Copy Code
+: $a + $b plus $a plus $b-: $a-$b minus $a minus $b*: $a * $b multiply by $a times $b/: $a/$b except $a divided by $b%: $a% $b modulo $a divided by the remainder
Make a paging display
Database Tutorial Connections
The code is as follows
Copy Code
?$conn =mysql Tutorial _connect ("127.0.0.1", "", "");mysql_select_db ("Shop");?>
The key is to use the limit in the SQL
/*for (EXPR1; expr2; expr3) {statement}The following example is written with a for loop
The code is as follows
Copy Code
for ($i = 1; $i echo "Www.111cn.net prompts you that this is the first". $i. " Secondary cycle ";}?
php method to get checkbox value
check one Check two Check three Check four ;? if ($_post) { $value = $_post[' checkbox '; echo ' you chose: '. Implode (', ', $value); //because of
MIME decoding class(Author: Chen Junqing October 24, 2000)A class that implements MIME decodingDecode ($ head = null, $ body = null, $ content_num =-1) is used to decode this class. For processing convenience, you must enter a two-character array,
It is very easy to obtain the current domain name. The code is as follows:Copy code // Obtain the current domain name:Echo $ _ SERVER ['server _ name'];// Obtain the source URL, that is, click the previous URL on this page.Echo $ _ SERVER ["HTTP_
Abstract class:It is used for inheritance and cannot be instantiated. It is used for standardization. Subclass must implement all abstract methods of the parent class.Interface:It can be understood as a stricter abstract class.First, like an
1. Add elements to a one-dimensional array$ ArrayList = ArrayListay ();Array_push ($ ArrayList, el1, el2... eln );But there is actually a more direct and convenient way: The code is as follows:Copy code $ ArrayList = ArrayListay ();$ ArrayList []
Knowledge points to be learned in the early stageMove_uploaded_file () file upload function The code is as follows:Copy code If (move_uploaded_file ($ _ FILES ["filename"] ["tmp_name"]){Echo 'file uploaded successfully ';} $ _ FILES php global
Use of the PHP glob function: glob-find the file path that matches the patternExample The code is as follows:Copy code $ FileList = glob ('*.*');For ($ I = 0; $ I Echo $ fileList [$ I]. ' ';}$ FileList2 = glob ('images /*');For ($ I = 0; $ I
In PHP, there is no default Function to get the URL of the current page. So today we will introduce a PHP Function for getting the complete URL of the current page in PHP.CodeThe function code is as follows. You only need to use curPageURL () for
Example The code is as follows:Copy code $ PostInfo ['answer2'] = 'Yes, commercial loans can be shared by 36%, and provident fund loans can be shared by 16% ||| you can extract the balance from your account for down payment, then, each month,
Let's first look at the Directory Traversal The code is as follows:Copy code Function tree ($ directory){ $ Mydir = dir ($ directory );Echo " n ";While ($ file = $ mydir-> read ()) { If (is_dir ("$ directory/$ file") AND ($ file! = ".") AND ($
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