array_combine: Creates an array by using one array for keys and another for its values
<?php
$abbreviations = array("AL","AK","AZ","AR");
$states = array("Alabama","Alaska","Arizona","Arkansas");
$stateMap = array_combine($abbreviations,$states);
print_r($stateMap);
?>
Related examples in the same category