note 36281 deleted from function.array-multisort by didou
| From: | didou@php.net | Date: | Fri, 03 Oct 2003 10:08:59 +0000 |
| Subject: | note 36281 deleted from function.array-multisort by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57671@lists.php.net to get a copy of this message | ||
Note Submitter: Lorenzo Gordon www.orangeideas.co.uk
----
In response to the posting by hav0x on 04-Apr-2003,
I found a way around the problem of submitting the paramters such as SORT_ASC, etc from a variable:
Use the constant() function (see www.php.net/manual/en/function.constant.php).
Example:
array_multisort($Array1, constant("$SortOrder"), constant("$SortType"),
$Array2);
Where $SortOrder or $SortType might be passed through another function, or from an html form.
You just need to make sure that the content of these variables is the literal string of the constant
you wish to use (e.g. 'SORT_ASC').
HTH.
Lorenzo.