Array Multisort Issue
Moderator: General Moderators
-
rswiderski
- Forum Newbie
- Posts: 2
- Joined: Sat May 09, 2009 9:27 pm
Array Multisort Issue
I do development using WOS Portable. I am using array_multisort to sort a series of arrays. It works fine. I've uploaded the code to the web host, but it doesn't work there. I've put in debug statements and have isolated the issue to be the array_multisort statement; it just doesn't sort the arrays. Is there some environment or .ini setting that controls how that function works? I've used the same code on a different hosting environment without a problem. Anyone have an idea where I could look next?
Re: Array Multisort Issue
As far as I know that func is not dependent on any ini setting. I'd create a test.php and use simple arrays along with the func by itself to see if it works (as it should). This should narrow down if you have a software issue or just logic issue in your code
-
rswiderski
- Forum Newbie
- Posts: 2
- Joined: Sat May 09, 2009 9:27 pm
Re: Array Multisort Issue
It appears to be an issue with arrays in a object. The arrays that I was sorting were part of an object. When they were passed into array multisort in the older version of PHP, they were sorted. The newer version didn't. Maybe it is a situation where the arrays were passed by reference in the older version and by value in the newer version. What I did to fix the problem was to copy them to non object-based arrays, sort, and then copy back. That worked. I hope this helps anyone who may have a similar issue.