<?php
$array1 = array();
$array2 = array(1 => "data");
$result = array_merge($array1, $array2);
?>
数値添字が振りなおされることに注意!
Array
(
[0] => data
)
$result = $array1 + $array2;
とすれば想定通り動く
Go to list of users who liked
More than 5 years have passed since last update.
<?php
$array1 = array();
$array2 = array(1 => "data");
$result = array_merge($array1, $array2);
?>
数値添字が振りなおされることに注意!
Array
(
[0] => data
)
$result = $array1 + $array2;
とすれば想定通り動く
Register as a new user and use Qiita more conveniently
Go to list of users who liked