When modifying a php form, how does one display the values of multiple selection boxes including the selected and unselected php forms? when modifying a php form, you must first check the data from the database and display it, but how can I display the selected and unselected items in the multiple selection box! This is what I did when displaying the value queried from the database on the php modification page. I really don't know how to write it: & nbsp; echo & nbsp; & lt; td & nbsp; & gt; user Hobbies & lt; how to display the value of the multiple-choice box when modifying the td php form, including the selected and unselected
When modifying a php form, you need to first display the data from the database. but how can I display the selected and unselected data in multiple selection boxes! This is what I did when I display the value queried from the database on the php modification page. I really don't know how to write it: echo'User hobbies';
$ Newstring = "playing football, playing basketball, playing table tennis, and playing badminton ";
$ New = "playing football, playing table tennis, and playing badminton ";
$ One = "playing football and playing badminton ";
// $ Newarray = arrar ("playing football", "playing basketball", "playing table tennis", "playing badminton ");
// $ Len = strlen ($ resu ["hobbet"]);
$ String = $ resu ["hobbet"];
// Print_r ($ string); die ();
// Print_r (substr ($ string, 9, 21); die ();
If (strstr ($ newstring, $ string) = "playing football, playing basketball, playing table tennis, and playing badminton "){
If (substr ($ string, 9, 18) = "playing basketball "){
// Echo "jdljfl"; die ();
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Else {
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
}
} Elseif (strstr ($ newstring, $ string) = "playing basketball and table tennis "){
If (substr ($ string, 9, 21) = ""){
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Else {
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
}
} Elseif (strstr ($ newstring, $ string) = "playing table tennis and badminton "){
If (substr ($ string, 12, 24) = "playing badminton "){
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Else {
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Elseif (strstr ($ newstring, $ string) = "playing badminton "){
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Else {
// Echo "woshishui"; die ();
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
}
/* Switch ($ len ){
Case 3:
If (substr ($ resu ["hobbet"], 0, 1) = "kick "){
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
} Else {
Echo' Play football Playing basketball Playing table tennis Playing Badminton';
}
}
Break;
Case 4:
Echo ""; break;
Default echo "1 ";*/
Echo'';
------ Solution ----------------------
Put all values into an array
The selected items can be found, and the remaining items are unselected.
------ Solution ----------------------
Okay, top of you