List Info

Thread: note 77442 added to function.array-filter




note 77442 added to function.array-filter
user name
2007-08-29 17:49:21
Just a simplification of my function from last month.

<?php
function partition($input, $callback=null)
{
	if(is_null($callback))
		$true = array_filter($input);
	else
		$true = array_filter($input, $callback);

	$false = array_diff_key($input, $true);
}
?>
----
Server IP: 203.89.181.186
Probable Submitter: 60.234.168.92
----
Manual Page -- http://www.php.net/manual/en/function.array-filter.php

Edit        -- https://master
.php.net/note/edit/77442
Del: integrated  -- h
ttps://master.php.net/note/delete/77442/integrated
Del: useless     -- http
s://master.php.net/note/delete/77442/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/77442/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/77442/spam
Del: non-english -- 
https://master.php.net/note/delete/77442/non-english
Del: in docs     -- http
s://master.php.net/note/delete/77442/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/77442
Reject      -- https://mast
er.php.net/note/reject/77442
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )