I want to append: selected="selected" to an option in my dropdown if my session value is equal to the value of the option.
Example:
if($_SESSION['sms-timezone'] == 'Africa/Abidjan')
append selected="selected" where option value="Africa/Abidjan"
<select>
<option value="Africa/Abidjan"> Africa/Abidjan( +00:00 GMT ) </option>
<option value="Africa/Asmera"> Africa/Asmera( +03:00 GMT ) </option>
<option value="Africa/Bamako"> Africa/Bamako( +00:00 GMT ) </option>
<option value="Africa/Bangui"> Africa/Bangui( +01:00 GMT ) </option>
<option value="Africa/Banjul"> Africa/Banjul( +00:00 GMT ) </option>
<option value="Africa/Bissau"> Africa/Bissau( +00:00 GMT ) </option>
The reason for appending to the option is because the dropdown contains 500+ items.