Q: How to make single array of two array object? How to make single array array object of two array object
I have the following two arrays of objects
How to make single array array object of two array object
I have the following two arrays of objects
   Array
    (
        [0] => stdClass Object
            (
                [id] => 25
                [authorityId] => 2
                [grantVillage] => test
                [agency] => test
                [certificate] => Panding
                [amount] => 50000
                [startDate] => 2015-12-08
                [endDate] => 2015-12-08
                [grantArea] => test
                [added_date] => 0000-00-00
            )

        [1] => stdClass Object
            (
                [id] => 26
                [authorityId] => 2
                [grantVillage] => testing2
                [agency] => testing
                [certificate] => Verified
                [amount] => 50000
                [startDate] => 1970-01-01
                [endDate] => 1970-01-01
                [grantArea] => test
                [added_date] => 0000-00-00
            )

    )
    Array
    (
        [0] => stdClass Object
            (
                [name] => kandi Area
            )

        [1] => stdClass Object
            (
                [name] => kandi Area
            )

    )

I want to make it:
 Array
    (
        [0] => stdClass Object
            (
                [name] => kandi Area
                [id] => 25
                [authorityId] => 2
                [grantVillage] => test
                [agency] => test
                [certificate] => Panding
                [amount] => 50000
                [startDate] => 2015-12-08
                [endDate] => 2015-12-08
                [grantArea] => test
                [added_date] => 0000-00-00
            )

        [1] => stdClass Object
            (
                [name] => kandi Area
                [id] => 26
                [authorityId] => 2
                [grantVillage] => testing2
                [agency] => testing
                [certificate] => Verified
                [amount] => 50000
                [startDate] => 1970-01-01
                [endDate] => 1970-01-01
                [grantArea] => test
                [added_date] => 0000-00-00
            )

    )

Any help will be appreciated.Thanks in advance.

A: You can simply use array_merge for this:
$combinedArray = array_merge($array1, $array2);

Edit: Misunderstood your question, the following would work as you simply need to loop through array 2 and add these values to array 1:
<?php      
  $array1 = array (
    0 => array (
      "id" => "25",
      "authorityId" => "2",
    ),
    1 => array (
      "id" => "26",
      "authorityId" => "2",
    )
  );

  $array2 = array (
    0 => array ( 
      "name" => "kandi Area"
    ),
    1 => array ( 
      "name" => "kandi Area"
    )
  );

  foreach ($array2 as $array2Key => $array2ValuesArray) {
    # This works for serialized arrays:
    // $array1[$array2Key]['name'] = $array2ValuesArray['name']; 
    # However this does not relate to the OP which means that this will work for stdClass Objects:
    $array1[$array2Key]->name = $array2ValuesArray->name;
  }

  echo '<pre>';
  print_r($array1);
  echo '</pre>';
?>

Edit: This results in the following output:
array
(
  [0] => stdClass Object
  (
    [id] => 25
    [authorityId] => 2
    [name] => kandi Area
  ),
  [1] => stdClass Object
  (
    [id] => 26
    [authorityId] => 2
    [name] => kandi Area
  )
)


A: You can merge the two array objects and can get an array object by following this question : 
How to merge two arrays of object in PHP
Once you get the merge array object. You can convert the array object(std class) into array by this  code snippet :
$array = json_decode(json_encode($ArrayObject),true);

