phparraysassociative-arraymerging-data

Merge two associative arrays


I have two arrays:

aid = [$aid]=>1
amount = [$aid] = $70

How can I rewrite these two separate arrays to be one array:

payout = [aid] => $aid, [amount] => $70

Solution

  • I believe you are looking for php's array_merge(...)

    http://php.net/manual/en/function.array-merge.php