PHP, is the abbreviation of English Super Text preprocessing language hypertext preprocessor. PHP is an HTML embedded language, is a server-side implementation of embedded HTML document scripting language, language style has similar to C language, is widely used. This article summarizes the 8 tips commonly used in daily development of PHP.
1. Naming
- ' checkbox ' name= ' checkbox[] ' value= $dwmyrow
2. Use
When the plan is part of a SQL instruction: if the field that participates in the control is numeric, the
- Ifemptyempty($_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, the
- Ifemptyempty($_post[' checkbox '])) {
- $expr"'". Join ("', '"$_post[' CheckBox ']). "." ;
- $sql"select * from Tbl_name where field in ($expr)";
- }
PHP determines whether a form form is submitted
- $action = $HTTP _post_vars ["Button1"];
- if ($action= ="Submit")
- {
- }
- Else
- {
- }
PHP Gets the string length
- strlen ($myrow
PHP URL Steering
- Header ("Location:". ) $_server ["Http_referer"]);
PHP Hyper-Global objects
-
- $a = 1;
- $b = 2;
- function Sum ()
- {
- $GLOBALS ["B"$GLOBALS["a"$GLOBALS ["B"];
- }
- Sum ();
- echo$b;
- ?>
PHP form Values
If mothod= "get" uses $_get["test" instead of $test
If mothod= "POST" uses $_post["test" instead of $test
PHP Gets the current IP
- $HTTP _server_vars ["REMOTE_ADDR"]?>
- PHP Gets the current time
-
- echodate("y-m-d g:i:s");
- ?>
- Date ("y year M D Day")
- Date ("Y-n-j"
Hope that through the introduction of this article, can bring you help.
http://www.bkjia.com/PHPjc/445750.html www.bkjia.com true http://www.bkjia.com/PHPjc/445750.html techarticle PHP, is the abbreviation of English Super Text preprocessing language hypertext preprocessor. PHP is an HTML embedded language, is a server-side execution of embedded HTML document script language, ...