-2

How to 1 output from 2 output ?

<?php

[a] => Array
        (
            [0] => 72.89.122.00:50827
            [1] => 62.173.145.00:17211
        );

[b] => Array
        (
            [0] => 61.10.231.00:52151
            [1] => 66.171.81.00:41787
        );
?>

I need output:

[total] => Array
        (
            [0] => 72.89.122.00:50827
            [1] => 62.173.145.00:17211
            [2] => 61.10.231.00:52151
            [3] => 66.171.81.00:41787
        );
Rizier123
  • 58,877
  • 16
  • 101
  • 156
  • 2
    So you have **array**'s which you want to **merge**, so the logic function name **()** would be: [`array_merge()`](http://php.net/manual/en/function.array-merge.php) – Rizier123 Apr 20 '15 at 13:18
  • how to use array_merge ()? – Andy Triyanto Apr 20 '15 at 13:19
  • Ask google OR read the manual! We can't learn for you – Rizier123 Apr 20 '15 at 13:20
  • This isn't a duplicate of the indicated question - that one is about flattening arrays that contain arrays, where this is about merging distinct arrays. It's more a duplicate of this one: http://stackoverflow.com/questions/2650177/cant-concatenate-2-arrays-in-php – Always Learning Apr 20 '15 at 13:24
  • @stvcisco Since OP doesn't show us the **real** array structure right now this seems like a multidimensional array. – Rizier123 Apr 20 '15 at 13:30

2 Answers2

0

Take a look at array_merge(); http://php.net/manual/en/function.array-merge.php

$newArray = array_merge($a,$b);
Epodax
  • 1,828
  • 4
  • 27
  • 32
0

Use the array_merge function described here.

Always Learning
  • 5,510
  • 2
  • 17
  • 34