Simple function for drawing HTML dropdown list from various sources
If you’re still lurking in the darkness of writing code with pure PHP and not using any framework then in this post you can find some nifty function, useful for drawing a HTML list boxes.
Basically it tries to render (draw) a <select>
element basing on input data provided in $source
variable. It can be either a list (key=>value) or string, where values and items’ texts are separated with delimiter. Such string can be provided directly or read from file. In this case you only provide path to a file (source of data).
Read More “Simple function for drawing HTML dropdown list from various sources”