Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array merge laravel

// From PHP 7.4, you can use the spread syntax to merge arrays in PHP like JavaScript
$firstArray = ['a' => 'life', 'b' => 'ball'];
$secondArray = ['c' => 'History'];

$thirdArray = [...$firstArray, ...$secondArray];

// you can still use the array_merge function

$thirdArray = array_merge($firstArray, $secondArray);
Source by laravel-code.tips #
 
PREVIOUS NEXT
Tagged: #array #merge #laravel
ADD COMMENT
Topic
Name
7+1 =