note 117283 added to function.array-filter

From: Date: Sat, 16 May 2015 13:49:40 +0000
Subject: note 117283 added to function.array-filter
Groups: php.notes 
Request: Send a blank email to php-notes+get-202568@lists.php.net to get a copy of this message
from php 5.3, we use anonymous function as second argument: $a = array('a'=>1, 'b'=>2, 'c'=>false, 'd'=>0); $b = array_filter($a, function($v){return $v !== 0;}); var_dump($b); output: array(3) { 'a' => int(1) 'b' => int(2) 'c' => bool(false) } ---- Server IP: 72.52.91.14 Probable Submitter: 96.44.186.68 ---- Manual Page -- http://php.net/manual/en/function.array-filter.php Edit -- https://master.php.net/note/edit/117283 Del: integrated -- https://master.php.net/note/delete/117283/integrated Del: useless -- https://master.php.net/note/delete/117283/useless Del: bad code -- https://master.php.net/note/delete/117283/bad+code Del: spam -- https://master.php.net/note/delete/117283/spam Del: non-english -- https://master.php.net/note/delete/117283/non-english Del: in docs -- https://master.php.net/note/delete/117283/in+docs Del: other reasons-- https://master.php.net/note/delete/117283 Reject -- https://master.php.net/note/reject/117283 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202568) next »