Home >Backend Development >PHP Tutorial > php的array_key_exists函数奇怪有关问题

php的array_key_exists函数奇怪有关问题

WBOY
WBOYOriginal
2016-06-13 13:10:30986browse

php的array_key_exists函数奇怪问题

  $arrFinal = array(); 
  for($i=0;$i   {
if( array_key_exists('aa', $arrFinal) )
continue;

array_push( $arrFinal, array('aa' => 'bb') );  
  }

执行完后,会有5个结果,而不是1个结果, array_key_exists没有工作,求解释

------解决方案--------------------
好的 趁你还清醒快点结帖
------解决方案--------------------
楼上太腹黑了,故意发个回帖让楼主不能删帖回收可用分…………

给个建议,array_key_exists不如isset

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn