I always used a very elegant solution, similar to those already presented, which does not require a lot of additional code.
HTML
<select name="make"> <option value="1:First Option">First Option Text</option> <option value="2:Second Option">Second Option Text</option> <option value="3:Third Option Text">Third Option Text</option> </select>
Php
$value = split(':', $make)[0]; $text = split(':', $make)[1];
Advantages of this method
Yes, there is definitely a resemblance to the serialworm answer, but we minimize the code in our PHP block by quietly moving to the array and immediately select the element.
In my case, I use this exact short code in the form of a contact, where this one-line (to get the department name selected) is crucial to keep the code looking clean.
Programmer
source share