【发布时间】:2012-02-21 05:14:27
【问题描述】:
好吧,我知道可以这样...
$Array1 = array("Hello, ", "foo", "The quick brown fox jumped ");
$Array2 = array("World!", "bar", "the lazy dog.");
$Array3 = array();
for($x = 0; $x < count($Array1); $x++) {
$Array3[] = $Array1[$x] . $Array2[$x];
}
// returns this -> ("Hello, World", "foobar", "The quick brown fox jumped over the lazy dog.")
但是有没有一个原生的 PHP 函数呢?像这样:
$Array3 = array_concat_strings($Array1, $Array2)
我在 php.net 上进行了搜索,但没有找到任何东西,但我想确保我没有遗漏任何东西。
【问题讨论】: