Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38199 invoked by uid 1010); 25 Oct 2004 12:49:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38173 invoked from network); 25 Oct 2004 12:49:42 -0000 Received: from unknown (HELO orion.naeberg.org) (195.137.249.185) by pb1.pair.com with SMTP; 25 Oct 2004 12:49:42 -0000 Received: from ip-228.net-81-220-166.nice.rev.numericable.fr ([81.220.166.228] helo=[192.168.0.2]) by orion.naeberg.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.42 (FreeBSD)) id 1CM4I9-000DUm-Jv for internals@lists.php.net; Mon, 25 Oct 2004 14:49:41 +0200 Message-ID: <417CF662.9080204@naedev.naellia.org> Date: Mon, 25 Oct 2004 14:49:38 +0200 User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orion.naeberg.org X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [26 6] X-AntiAbuse: Sender Address Domain - naedev.naellia.org X-Source: X-Source-Args: X-Source-Dir: Subject: Can *sort functions return the sorted array ? From: fulax@naedev.naellia.org (Fulax) Hi, I wonder if it will be possible to add an extra argument to the *sort functions to get the sorted array directly. At the moment I have made my own function to do this, here is an example with natsort : function arrnatsort($a_array) { if(natsort($a_array)) return $a_array; else return false; } I think it will more convenient to simply call $array = natsort($array,true);, when you need to combine functions, like this : $sSortedString = join(',',arrnatsort(explode(',',$sString))); At the moment, the way is to create an auxilliary function, or to make more steps : $aTemArray = explode(',',$sString); natsort($aTempArray); $sSortedString = join(',',$aTempArray); unset $aTempArray; Does it make sense to add the possibility for an extra argument ? Like highlight_string function, the extra argument return the string instead of displaying it. Thanks in advance, and sorry for my crapy English Cyprien