View Single Post
Old Jan 31st, 2008, 12:39 PM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,888
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Function too convoluted?

Very nice!

If that still meets your initial requirements, I'd say that's a much nicer solution, yes?

And if you don't want to worry about the bad garbage cleanup of "create_function", you could also pass through a named function like so, I believe...

PHP Syntax (Toggle Plain Text)
  1. function callback_func($key, $value) { return ($value < 2 || $value > 70); }
  2.  
  3. print_r(array_filter_multi($data, $callback_func, null));

I'm not as sure about that. But it should work.
By the way, ? true : false is a redundant statement.
Sane is online now   Reply With Quote