Ben bu dizi varsa
$england = array(
'AVN' => 'Avon',
'BDF' => 'Bedfordshire',
'BRK' => 'Berkshire',
'BKM' => 'Buckinghamshire',
'CAM' => 'Cambridgeshire',
'CHS' => 'Cheshire'
);
Ben tam metin sürümü, nasıl ben aşağıdaki işlevi yazarsınız gelen üç harfli kodunu elde edebilmek istiyorum:
$text_input = 'Cambridgeshire';
function get_area_code($text_input){
//cross reference array here
//fish out the KEY, in this case 'CAM'
return $area_code;
}
teşekkürler!