note 99358 added to function.array-filter

From: Date: Thu, 12 Aug 2010 15:09:07 +0000
Subject: note 99358 added to function.array-filter
Groups: php.notes 
Request: Send a blank email to php-notes+get-171614@lists.php.net to get a copy of this message
Because array_filter() preserves keys, you should consider the resulting array to be an associative array even if the original array had integer keys for there may be holes in your sequence of keys. This means that, for example, json_encode() will convert your result array into an object instead of an array. Call array_values() on the result array to guarantee json_encode() gives you an array. ---- Server IP: 69.147.83.197 Probable Submitter: 195.169.146.12 ---- Manual Page -- http://www.php.net/manual/en/function.array-filter.php Edit -- https://master.php.net/note/edit/99358 Del: integrated -- https://master.php.net/note/delete/99358/integrated Del: useless -- https://master.php.net/note/delete/99358/useless Del: bad code -- https://master.php.net/note/delete/99358/bad+code Del: spam -- https://master.php.net/note/delete/99358/spam Del: non-english -- https://master.php.net/note/delete/99358/non-english Del: in docs -- https://master.php.net/note/delete/99358/in+docs Del: other reasons-- https://master.php.net/note/delete/99358 Reject -- https://master.php.net/note/reject/99358 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171614) next »