PHP checkbox check box value get and CheckBox default Output Method _php tutorial

Source: Internet
Author: User
how PHP Gets the checkbox check box value
Copy CodeThe code is as follows:



<title>How PHP Gets the checkbox check box value</title>





if ($_post)
{
$value = $_post[' checkbox '];
Echo ' You have chosen: '. Implode (', ', $value);
Because of the CheckBox property, we must set the checkbox's name to a checkbox[] so that PHP can read the value of the checkbox in the form of data, otherwise it will not read correctly. Script House Jb51.net Finishing
}
?>


checkbox in PHP to read the value of the array form Oh, we read these values in PHP post to get is in an array form Oh,
Copy CodeThe code is as follows:




<title>PHP Get marquee checkbox Value</title>


$area _arr = Array ();
if ($_get[' action ']== "submit") {
$area _arr = $_post[' area ');
}
echo "Your selected region is:";
foreach ($area _arr as $k = + $v) {
echo $v. " ";
}
?>




php checkbox Default selection problem (this is the principle of use)
Copy CodeThe code is as follows:
>

http://www.bkjia.com/PHPjc/321742.html www.bkjia.com true http://www.bkjia.com/PHPjc/321742.html techarticle php gets the checkbox check box value copy code code as follows: HTML xmlns= "http://www.jb51.net/1999/xhtml" head meta http-equiv= "Content-type" Content= "text/html; charset=gb231 ...

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.