how to get value from dropdown list in php?
4 Answers. $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.