Created
November 18, 2017 09:21
-
-
Save kuredev/b193cedf4f7df8efaf40b0ad0873a166 to your computer and use it in GitHub Desktop.
array_reduceの小さなメモ
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 | |
function merge(string $str1 = null, string $str2){ | |
$str = $str1.$str2; | |
return $str; | |
} | |
$arr = array("str1", "str2", "str3", "str4"); | |
echo array_reduce($arr, "merge"); | |
echo PHP_EOL; | |
echo array_reduce($arr, "merge", "str0"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行結果