Last active
August 29, 2015 13:59
-
-
Save tototoshi/10626280 to your computer and use it in GitHub Desktop.
array_merge 怖い
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* !! 入力配列の中にある数値添字要素の添字の数値は、 結果の配列ではゼロから始まる連続した数値に置き換えられます。 */ | |
$a = array( | |
'a' => 'aaa', | |
'100' => '100100100', | |
); | |
$b = array( | |
'b' => 'bbb', | |
); | |
var_dump(array_merge($a, $b)); | |
/* | |
array(3) { | |
["a"]=> | |
string(3) "aaa" | |
[0]=> | |
string(9) "100100100" | |
["b"]=> | |
string(3) "bbb" | |
} | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
怖い