How to merge two array into single array in php ?

I am explaining you, how to merge two array into single array in php. we can use array_merge() function in php code so that will merge two different array into single array.
here I having two array called arrayfirst and arraysecond array, I will merge both array into single array with arraymerge new array.

Example :

<?php
  $arrayfirst = array("Webdeveloperindia.in", "markdevelopments.com", "pakizacity.com");
  $arraysecond = array("alphaonemall.com", "indiansgottalent.com", "wordpressminds.com");
   //merge two arrays into single array
  $arraymerge = array_merge($arrayfirst, $arraysecond);
  print_r($arraymerge);

  ?>

Output :

 Array ( [0] => Webdeveloperindia.in [1] => markdevelopments.com [2] => pakizacity.com [3] => alphaonemall.com [4] => indiansgottalent.com [5] => wordpressminds.com )

Leave a Reply

Your email address will not be published. Required fields are marked *

38 − = 36