Organizational Research By

Surprising Reserch Topic

Question:how to truncated extra values, and only went as far as keys without throwing a warning as array_combine does.



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
16 views



Related Hot Questions

1 Answer

0 votes

 

function safeArrayCombine($keys, $values) { 
    $combinedArray = array(); 
        
    for ($i=0, $keyCount = count($keys); $i < $keyCount; $i++) { 
         $combinedArray[$keys[$i]] = $values[$i]; 
    } 
        
    return $combinedArray; 
} 
?>
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...