array inside array or nested array : I have 3 arrays like this.

    $a1 = array(array("val" => "Facebook"),array ("val" => "Instagram"));
    $a2 = array(array("expenses" => "84512"),array ("expenses" => "123"));
    $a3 = array(array("social_id" => "1"),array ("social_id" => "2"));

and I want to output.

    $result = array(array("val" => "Facebook", "expenses" => "84512", "social_id" => 1),array("val" => "Instagram", "expenses" => "123", "social_id" => 2));

but this should be dynamic, the length of the above  3 array can be varies
