Jump to content


rascle

Member Since 15 Jan 2009
Offline Last Active Nov 19 2012 01:42 PM

Topics I've Started

Sort Array By Values

19 November 2012 - 12:56 PM

Hi

I have an array (which is an equation) lets say it is
Array ( [0] => 18x [1] => 10x^2 [2] => 17 )

I want to order the array in terms of the value after ^, so that the highest values after ^ are grouped first. Therefore the above array I want it sorted to become
Array ( [0] => 10x^2 [1] => 18x [2] => 17 )
Does anyone have any idea how I would sort it? I have tried using php sort() to no avail.

Thanks,

Rhys

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com