here is perfect function in PHP itself called "array_combine()"
/*-----------------------------------------------------------
| Parameter | Description |
-------------------------------------------------------------
| array1 Required. | An array, specifying the keys |
-------------------------------------------------------------
| array2 Required. | An array, specifying the values |
-----------------------------------------------------------*/
$array1 = ('John','Mark','Ester');
$array2 = (1111,2222);
// if some elements dont exists, "add" them...
if(count($array1) != count($array2))
{
foreach($array as $key => $value):
if(!isset($array2[$key]) $array2[$key] = NULL;
endforeach;
}
// now, combine them in classic way...
$combined = array_combine($array1,$array2);