title: merge two array in one array
body: <p>I have two array, $result and $social_result. I have to merge both tables. social_icons_id of $result matches id of $social_result. If match then show link of $result array otherwise blank.</p>
  
  <p>I have an array </p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [social_icons_id] =&gt; 14
          [link] =&gt; www.instagram.com
          [edittemplate_id] =&gt; 218
          [name] =&gt; Email
          [image] =&gt; email.png
      )
  
  [1] =&gt; Array
      (
          [social_icons_id] =&gt; 16
          [link] =&gt; www.instagram.com
          [edittemplate_id] =&gt; 218
          [name] =&gt; Blogger
          [image] =&gt; blogger.png
      )
   )
  </code></pre>
  
  <p>Another is: </p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [id] =&gt; 13
          [name] =&gt; Address
          [image] =&gt; address.png
      )
  
  [1] =&gt; Array
      (
          [id] =&gt; 14
          [name] =&gt; Email
          [image] =&gt; email.png
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 15
          [name] =&gt; Fax
          [image] =&gt; fax.png
      )
  
  [3] =&gt; Array
      (
          [id] =&gt; 16
          [name] =&gt; Text
          [image] =&gt; text.png
      )
  
  [4] =&gt; Array
      (
          [id] =&gt; 17
          [name] =&gt; Website
          [image] =&gt; Website.png
      )
   )
  </code></pre>
  
  <p>Now I have to merge both table in one table like:</p>
  
  <pre><code>Array
  (
  [0] =&gt; 
  [1] =&gt; www.instagram.com
  [2] =&gt; 
  [3] =&gt; 
  [4] =&gt; 
  [5] =&gt; www.instagram.com
  [6] =&gt; 
  [7] =&gt; 
  [8] =&gt; 
  [9] =&gt; 
  [10] =&gt; 
  [11] =&gt; 
  [12] =&gt; 
  [13] =&gt; 
  [14] =&gt; 
  [15] =&gt; 
  [16] =&gt; 
  )
  </code></pre>
  
  <p>id of both tables matches and make one table.
  I tried-</p>
  
  <pre><code>$result = $obj-&gt;select_social_ids($id); // for first table
  
  $social_result = $obj-&gt;show_social_icons(); // for second table
  
  for($j=0;$j&lt;count($social_result);$j++)
  {
   if(in_array($social_result[$j]['id'], $result)) { // search value in the array
      $link[] = $result[$j]['link'];
  }
  else
  {
      $link[] = '';
  }
  }
  </code></pre>
  
  <p>But not working.</p>