SyntaxFix
Write A Post
Hire A Developer
Questions
$animals = array('--Select Animal--', 'Cat', 'Dog', 'Cow'); $selected_key = $_POST['animal']; $selected_val = $animals[$_POST['animal']];
Use your $animals list to generate your dropdown list; you now can get the key & the value of that key.