note 94849 added to function.in-array

From: Date: Sat, 28 Nov 2009 14:17:06 +0000
Subject: note 94849 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-163361@lists.php.net to get a copy of this message
Found strange things, for example create such array $arSortFields=array('id','title); and do such thing echo intval(in_array(0,$arSortFields)); You will get "1" in echo! Thats means that element 0 is in array! But if you do echo intval(in_array(0,array()); you will got 0 as expected. So be carefull to pass 0 as first parameter ---- Server IP: 195.54.192.44 Probable Submitter: 80.70.233.3 ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- https://master.php.net/note/edit/94849 Del: integrated -- https://master.php.net/note/delete/94849/integrated Del: useless -- https://master.php.net/note/delete/94849/useless Del: bad code -- https://master.php.net/note/delete/94849/bad+code Del: spam -- https://master.php.net/note/delete/94849/spam Del: non-english -- https://master.php.net/note/delete/94849/non-english Del: in docs -- https://master.php.net/note/delete/94849/in+docs Del: other reasons-- https://master.php.net/note/delete/94849 Reject -- https://master.php.net/note/reject/94849 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163361) next »