php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #10382 array_multisort() doesn't work as advertised
Submitted: 2001-04-18 13:57 UTC Modified: 2001-04-20 13:16 UTC
From: mnino at insightc dot om Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.4pl1 OS: Linux Redhat 6.2
Private report: No CVE-ID: None
 [2001-04-18 13:57 UTC] mnino at insightc dot om
Sorry, I submitted this to the 'add notes' for the online manual thinking that was where I might get information.

What I did is  cut-&-pasted the code from documentation for the function array_multisort() into a brand new PHP script and added some print_r() calls. The function array_multisort() doesn't work as adverstised. :] It generates an error: Warning: Argument 3 to array_multisort() is expected to be an array in array_multisort.php on line 9 

Here is the PHP file array_multisort.php: 
<pre> 
<?php 

$ar = array (array ("10", 100, 100, "a"), array (1, 3, "2", 1)); 

print_r($ar); 

array_multisort ($ar[0], SORT_ASC, SORT_STRING, 
$ar[1], SORT_NUMERIC, SORT_DESC); 

print_r($ar); 

?> 
</pre> 

Can anyone assist?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-20 13:16 UTC] andrei@php.net
I cut & pasted your code and ran it against latest CVS version and it works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 23:01:30 2024 UTC