I am new in php and want to explore how the same thing can be achieved in different ways. I have the following working code and would like to see better ways of coding. Any suggestion is appreciated.
<?php
$districts = "Aizawl";
$fc = "First City";
$sc = "Second City";
$tc = "Third City";
if ($districts == "Aizawl") {
$city = $fc;
} elseif ($districts == "Lunglei") {
$city = $sc;
} elseif ($districts == "Saiha") {
$city = $tc;
}
?>
<?php
echo $city;
?>