note 17233 added to function.array-filter

From: Date: Fri, 30 Nov 2001 18:28:07 +0000
Subject: note 17233 added to function.array-filter
Groups: php.notes 
Request: Send a blank email to php-notes+get-21487@lists.php.net to get a copy of this message
<p>If you want to filter an array depending on a run time generated value which varies time to time, consider the following idea:</p> //just a very simple example array_filter($array, create_function('$element, $default='.$value, 'return $element == $default;')); <p>With create_function one can easily define a new function with different default arguments used in function body. <br>With these arguments one can access variables from other scope beside "global".</p> -- http://www.php.net/manual/en/function.array-filter.php http://master.php.net/manage/user-notes.php?action=edit+17233 http://master.php.net/manage/user-notes.php?action=delete+17233 http://master.php.net/manage/user-notes.php?action=reject+17233

« previous php.notes (#21487) next »