note 123260 added to function.in-array

From: Date: Thu, 25 Oct 2018 20:00:57 +0000
Subject: note 123260 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-209511@lists.php.net to get a copy of this message
If third parameter is not set to Strict then, the needle is found in haystack eventhought the values are not same. the limit behind the decimal seems to be 6 after which, the haystack and needle match no matter what is behind the 6th. Wrong Response. $os = array("652875063.10089021"); if (in_array("652875063.10089021", $os)) { echo "In Array"; } Correct Response $os = array("652875063.1008902"); if (in_array("652875063.1008901", $os)) { echo "In Array"; } ---- Server IP: 208.43.231.9 Probable Submitter: 38.72.131.146 ---- Manual Page -- http://php.net/manual/en/function.in-array.php Edit -- https://master.php.net/note/edit/123260 Del: integrated -- https://master.php.net/note/delete/123260/integrated Del: useless -- https://master.php.net/note/delete/123260/useless Del: bad code -- https://master.php.net/note/delete/123260/bad+code Del: spam -- https://master.php.net/note/delete/123260/spam Del: non-english -- https://master.php.net/note/delete/123260/non-english Del: in docs -- https://master.php.net/note/delete/123260/in+docs Del: other reasons-- https://master.php.net/note/delete/123260 Reject -- https://master.php.net/note/reject/123260 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209511) next »