这段代码运行后,我收到一个错误.我查找了可能的解决方案,但似乎所有内容都格式正确.
$searched = 'searched';
$count = '59';
$prop = Array();
$i = 0;
while ($i++ <= 4) {
array_push($prop[$i] = Array(
'text' => $searched,
'href' => 'http://mysite.com/?search=' . str_replace(' ', '+', $searched)
));
}
array_push($prop['Total Searches'] = $count);
Run Code Online (Sandbox Code Playgroud)
我在while循环中收到此错误5次,在while循环下收到array_push 1次.
Warning: Wrong parameter count for array_push()
Run Code Online (Sandbox Code Playgroud)
代码工作正常!但它仍然会调出错误.那么我应该压制错误吗?