当我尝试打印从该函数返回的数组时,我得到一个空白屏幕。array_combine为什么不返回数组?
我的阵列$terms
和$definitions
都是相同的长度,他们存在之前和之后我呼吁make_associative_array()
。
function make_associative_array() {
return array_combine($terms, $definitions);
}
$c = make_associative_array();
print_r($c);
$方面:
Array (
[0] => Nock (verb) [1] => End [2] => Serving [3] => Nock (noun)
)
$定义:
Array (
[0] => To place an arrow against the string prior to shooting. [1] => A group of arrows shot during a tournament. Usually 6. [2] => Thread wound around a bow string to protect the string. [3] => A notch at the rear of an arrow. The bow string is placed in the nock.
)
我使用PHP 27年6月5日
没有必要重复一个已经存在的答案(你可以投票现有的答案,你知道...) – Dekel
@Dekel。我没有重复答案。我给出答案,通过在localhost中执行hist代码给出答案。如果我们在localhost中exicute并发布它需要时间,当我们发布后 – iCoders
需要时间。您的回答正是我已经写过的。你能解释一下这些差异吗? – Dekel