I am working on a woocommerce site and I need to find a way to group select options in optgroups. My option are stored as array like No what I need is to make by php a select that would group the options in optgroup by using the string up to first space By using the function I can split
Tag: optgroup
Select Dropdown PHP foreach loop with ‘optgroup’ options
I have a dropdown menu with a PHP ‘foreach’ that I loop through to populate the select options. This works well. However, what I’d like to do is have various sub labels using the “optgroup” option. In …