Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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"
]
Comment

array marge in php

<?php
$a1=array("red","green");
$a2=array("blue","yellow");
print_r(array_merge($a1,$a2));
?>
Comment

merge array in php

$a1=array("red","green");
$a2=array("blue","green","yellow");
print_r(array_merge($a1,$a2));
Comment

php array merge

<?php
$array1 = array("color" => "red", 2, 4);
$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4);
$result = array_merge($array1, $array2);
print_r($result);
?>
Array
(
    [color] => green
    [0] => 2
    [1] => 4
    [2] => a
    [3] => b
    [shape] => trapezoid
    [4] => 4
)
Comment

PREVIOUS NEXT
Code Example
Php :: display pdf file in laravel 
Php :: valet select php version 
Php :: signup form in php 
Php :: php trim 
Php :: update cart subtotal woocommerce 
Php :: mp3 file upload code in php 
Php :: Laravel API Endpoint "401 Unauthorized" on Server But Works Fine On Localhost 
Php :: laravel count array 
Php :: jquery is less than or equal to 
Php :: php access key stdClass object 
Php :: add key value array php 
Php :: laravel sharing data 
Php :: laravel add request 
Php :: close connection pdo 
Php :: add custom shortcode in contact form 7 
Php :: laravel custom validation rules 
Php :: display data from two dimensional array in vew laravel 
Php :: PHP join() Function 
Php :: laravel notification 
Php :: database, counts 
Php :: composer create project laravel with version 
Php :: php one line if without else 
Php :: make resource in laravel 
Php :: install a package only composer dont update 
Php :: custom pagination in laravel 
Php :: laravel api 
Php :: laravel filter array 
Php :: Laravel permission to Vuejs 
Php :: php json pretty print and slash 
Php :: show phpinfo just modules 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =