I have 2 arrays. One is initialized with key names but with empty values :
$hits_arr = array(
'HD'=>'',
'CT'=>'',
'PS'=>'',
'LS'=>'',
);
Consider I have such string which is split into 4 different array elements:
$val = "8/2/9/4/";
$val = explode("/",$val);
My goal is to add each $val values to $hits_array so it would look like :
array (
'HD'=>"8"
'CT'=>"2"
'PS'=>"9"
'LS'=>"4"
)