[nycphp-talk] Inline Functions
Chris Bielanski
Cbielanski at inta.org
Wed Sep 1 14:59:38 EDT 2004
I don't think it's possible. If he's trying to avoid using globals, I'd
suggest that he create a sorting class and use member variables as his
globals for sorting, and then the usort callback function (class procedure)
can be privy to those private values.
Thanks,
Chris Bielanski
Web Programmer,
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org
INTA -- 125 Years of Excellence
> -----Original Message-----
> From: Mark Armendariz [mailto:nyphp at enobrev.com]
> Sent: Wednesday, September 01, 2004 2:53 PM
> To: 'NYPHP Talk'
> Subject: [nycphp-talk] Inline Functions
>
>
> I've been stumped by a question of a fellow freelancer today.
> Anyone know
> if it's possible in php to do something like this:
>
> usort($array, function($a, $b) {
> if($a == $b) return 0;
> return ($a < $b) ? -1 : 1;
> });
>
> Thanks!
>
> Mark
>
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
>
More information about the talk
mailing list