Answers for "how to concat two array in database in php"

PHP
4

php merge 2 arrays

<?php
  $array1 = [
      "color" => "green"
  ];
  $array2 = [
      "color" => "red", 
      "color" => "blue"
  ];
  $result = array_merge($array1, $array2);
?>

// $result
[
    "color" => "green"
    "color" => "red", 
    "color" => "blue"
]
Posted by: Guest on May-01-2020
1

php combine values of two arrays

$all_arrays = array_merge($array1, $array2, $array3, ...);
Posted by: Guest on October-31-2020

Browse Popular Code Answers by Language