Home  >  Article  >  Backend Development  >  android application development 8 tips commonly used in PHP development

android application development 8 tips commonly used in PHP development

WBOY
WBOYOriginal
2016-07-29 08:38:391032browse

PHP batch gets the checkbox value
1. Name

2. Use
when the plan is used as part of the sql command When: If the field participating in the control is numeric, then
if(! empty($_POST['checkbox'])) {
$expr = join(",", $_POST['checkbox']);
$ sql = "select * from tbl_name where field in ($expr)";
}
If the field participating in the control is numeric, then
if(! empty($_POST['checkbox'])) {
$expr = "'".join("','", $_POST['checkbox']).".";
$sql = "select * from tbl_name where field in ($expr)";
}
PHP determines the Form form Whether to submit
$action=$HTTP_POST_VARS["Button1"];
if($action=="Submit")
{
//Perform form operation
}
else
{
//Read default value
}
PHP Get the string length
strlen($myrow[1])
PHP Url redirection
Header("Location: ".$_SERVER["HTTP_REFERER"]);
PHP super global object
$a = 1;
$b = 2;
function Sum()
{
$GLOBALS["b"] = $GLOBALS["a"] + $GLOBALS["b"];
}
Sum();
echo $b;
?>
PHP form value
If method="get", use $_GET["test"] instead of $test
If method="post", use $_POST["test"] instead of $test
PHP obtain Current IP

PHP Get the current time
echo date("Y-m-d G:i:s");
?>
date("Y
Date ("Y-n-j")

The above introduces the 8 tips commonly used in PHP development for android application development, including the content of android application development. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn