Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Array unpacking support for string-keyed arrays - PHP 8.1

$arrayA = ['a' => 1];
$arrayB = ['b' => 2];

$result = ['a' => 0, ...$arrayA, ...$arrayB];

// ['a' => 1, 'b' => 2]
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #Array #unpacking #support #arrays #PHP
ADD COMMENT
Topic
Name
2+5 =