Using The Array_Merge () Function

 
      <?php
  $arrayA = array ("A", "B", "C", "D", "E");
  $arrayB = array (1, 2, 3, 4);
  $arrayAB = array_merge ($arrayA, $arrayB);  echo "The number of elements in \$arrayAB are: ", "\n";
  foreach ($arrayAB as $val) {
    echo "$val", "\n";
  }
  ?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.