How does php process multiple values processed from the form at a time and use "|" as the separator between values? For example, if you are interested in adding basketball or football, and so on, you can store them in the database as a field. | is used between football and basketball as the separator? How does php process multiple values processed from the form at a time and use "|" as the separator between values? For example, if you are interested in adding basketball or football, and so on, you can store them in the database as a field. | is used between football and basketball as the separator?
Reply content:
How does php process multiple values processed from the form at a time and use "|" as the separator between values? For example, if you are interested in adding basketball or football, and so on, you can store them in the database as a field. | is used between football and basketball as the separator?
If you wantHobbies
If the field stores multiple data items, we recommend that youHobbies
Stored as an array and used when stored in MySQLSerialize ()
Serialization, used for readingUnserialize ()
You can perform deserialization.
Serialization is a process of converting arrays or objects into strings so that they can be stored in the database.
// Example $ holobby = array ('basketball ', 'soccer', 'badminton ', 'computer'); echo serialize ($ Hober); // a: 4: {I: 0; s: 6: "basketball"; I: 1; s: 6: "football"; I: 2; s: 9: "badminton"; I: 3; s: 9: "computer ";}
How to UseSerialize ()
For the series of functions, refer to the manual:
Serilize ()
Unserilize ()
I can probably understand what you mean. I thought the same way when I didn't understand the database at first. How to store multiple values in the same field, in fact, you only need to create a new data table, such as db_hoby, the field is "holobby user_id ".