What are the common tips of PHP?
This article mainly shows you "what tips are commonly used in PHP", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the commonly used tips in PHP" this article?
1. Naming
2. Use
When the plan is part of the sql instruction: if the field participating in the control is numeric, then
If (! Emptyempty ($_ POST ['checkbox']) {$expr = join (",", $_ POST [' checkbox']); $sql = "select * from tbl_name where field in ($expr)";}
If the field that participates in the control is numeric,
If (! Emptyempty ($_ POST ['checkbox']) {$expr = "'" .join ("','", $_ POST ['checkbox']). "."; $sql = "select * from tbl_name where field in ($expr)";}
PHP determines whether the Form form is submitted or not
$action=$HTTP_POST_VARS ["Button1"]; if ($action== "submit") {/ / execute form action} else {/ / read default}
PHP gets the string length
Strlen ($myrow [1])
PHP Url steering
Header ("Location:". $_ SERVER ["HTTP_REFERER"])
PHP superglobal object
PHP form value
If mothod= "get", replace $test with $_ GET ["test"]
If mothod= "post", replace $test with $_ POST ["test"]
PHP gets the current IP
PHP got the current time date ("Y year m month d day") Date ("Y-n-j") above are all the contents of this article entitled "what are the common tips for PHP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!