How can I get the count of options in a select list in PHP

QuestionsHow can I get the count of options in a select list in PHP
Jehal Desai Staff asked 5 years ago

I have options that are populated conditionally in Javascript. In php, I need to get the count of options a particular select box has, then do a function based on the count of options.
Another idea is to put the option values in an array?
I was trying to avoid Javascript or jQuery bc I have to pass this info to a twig file to display a div with instructions for the user if something doesn't appear in the list.
HTML

PHP


View on Stack Overflow