How the PHP form displays the value of the multi box when it is modified contains the selected and unchecked

Source: Internet
Author: User
Tags php form
How the PHP form displays the value of the multi box when it is modified contains the selected and unchecked
PHP form in the changes, you need to first find out the data from the database to display, but the multi-box how to display the selected and not selected Ah! This is what I did when I showed the values I queried from the database in the PHP modification page, and I really don't know what to write: Echo 'User Hobby';
$newstring = "Play football, play basketball, play ping-pong badminton";
$new = "Play football and play ping-pong badminton";
$one = "Play football and play badminton";
$newarray = Arrar ("Play football", "Play Basketball", "play Table tennis", "play Badminton");
$len = strlen ($resu ["Hobbet"]);
$string = $resu ["Hobbet"];
Print_r ($string);d ie ();
Print_r (substr ($string, 9,21));d ie ();
if (Strstr ($newstring, $string) = = "Play football play basketball play table tennis Play Badminton") {
if (substr ($string, 9,18) = = "Play basketball") {
echo "JDLJFL";d ie ();
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}else{
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}
}elseif (Strstr ($newstring, $string) = = "Play basketball play table tennis Play Badminton") {
if (substr ($string, 9,21) = = "Play Table tennis") {
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}else{
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}

}elseif (Strstr ($newstring, $string) = = "Play table tennis and Play badminton") {
if (substr ($string, 12,24) = = "Play Badminton") {
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}else{
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}}elseif (Strstr ($newstring, $string) = = "Play Badminton") {
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}else{
echo "Woshishui";d ie ();
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}
/* Switch ($len) {
Case 3:
if (substr ($resu ["Hobbet"],0,1) = = "Kick") {
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}else{
Echo ' Play football Play Basketball Play Table Tennis Play Badminton';
}
}
Break

Case 4:
echo "";
Default echo "1"; */

Echo '';
------to solve the idea----------------------
Put all the values into an array

You can check it out, the rest is left unchecked.
------to solve the idea----------------------
All right, top you.
  • 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.