Jump to content

Select box from enum field


tibberous

Recommended Posts

I have an enum with three values: cat, dog, horse.

 

I want to make a select box, with an option from each of those three values. However, I want to create it dynamically, so if I add more options to the enum, I don't have to update the code. Is there an easy way to do this? It is something I always find myself wanting to do but can never find out how so I break down and just hard-code the select box.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/158645-select-box-from-enum-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.