array_combine : array_combine « Data Structure « PHP






array_combine

 
<?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

1.Combining Arrays