Reputation:
i have one array such as any $_POST
without key,after clear html tags i want to merge and combine with other array.for example
PHP
$farray= array($a , $b , $c);
i want to merge with below array:
PHP
$filter=array('id'=>$farray[0],
'description'=>$farray[1],
'portal'=>$farray[2]);
those array are sample like my code, how to merge this arrays, i dont want to use array cell
Upvotes: 1
Views: 102
Reputation: 86
<?php
$a1=array("a"=>"Horse","b"=>"Dog");
$a2=array("c"=>"Cow","d"=>"Cat");
print_r(array_merge($a1,$a2));
?>
output will be Array ( [a] => Horse [b] => Dog [c] => Cow [d]=>Cat)
Upvotes: 0
Reputation: 24645
$filter = array_combine(array("id","description", "portal"), $farray);
Upvotes: 5