How can I use a php array as the value of an HTML <option>?
e.g.
<select name='myname'>
<option value=' array("font-family" => "font-family: 'Yeseva One', serif","font-name" => "Yeseva One","css-name" =>"Yeseva+One")'>
Font 1
</option>
...
</select>
It kind of depends on what you want to archive in the end. I’ve got 3 options for you:
1) Json is pretty flexible:
You can then later on convert Json back to an array with json_decode.
2) If you need the data for server client side scripting, it would probably be a better idea to use HTML5’s data attributes:
3) You can use hidden input fields, which will allow you to retrieve the values like $_POST[‘font1’][‘css_name’] ect. :
You will obviously have to escape your values. But you get the idea.