HCProfessionals Posted October 3, 2011 Share Posted October 3, 2011 I need to sort this: customVar($var1, $var2, $var3); I have tried: sort(customVar($var1, $var2, $var3)); Quote Link to comment https://forums.phpfreaks.com/topic/248350-function-sorting/ Share on other sites More sharing options...
AbraCadaver Posted October 3, 2011 Share Posted October 3, 2011 sort() sorts an array. What are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/248350-function-sorting/#findComment-1275342 Share on other sites More sharing options...
Psycho Posted October 3, 2011 Share Posted October 3, 2011 What do the variables $var1, $var2, and $var3 contain and what do you expect the output to be? Quote Link to comment https://forums.phpfreaks.com/topic/248350-function-sorting/#findComment-1275347 Share on other sites More sharing options...
AbraCadaver Posted October 3, 2011 Share Posted October 3, 2011 Also, if you're trying to sort the result of a function that is an array you will need to assign the return to a variable and then sort it. Sort takes a reference and operates on the array "in place". Quote Link to comment https://forums.phpfreaks.com/topic/248350-function-sorting/#findComment-1275350 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.