Jump to content

PHP Sort Not Doing Anything


hkothari

Recommended Posts

So I'm trying to sort a simple array with 5 numbers in it, defined as so:

 

$array = array(123, 140, 3123, 3000, 545);

Then I try to sort it using the sort() function as so.

sort($array);

and that didn't work, so I tried adding the SORT_NUMERIC parameter, but that didn't help. Then I tried to print the output of sort because I know it returns a boolean on success, but it didn't return anything. Does anybody know what's happening? I've tried var_dumping before and after the sort and nothing is done.

Link to comment
https://forums.phpfreaks.com/topic/185335-php-sort-not-doing-anything/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.