Jump to content


rascle

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

Posts I've Made

In Topic: Sort Array By Values

19 November 2012 - 01:43 PM

Solved, thank you :D

In Topic: Sort Array By Values

19 November 2012 - 01:20 PM

But it isn't listing them how I want it, I'll have to do some more research unless you have any insights?

In Topic: Sort Array By Values

19 November 2012 - 01:18 PM

Using the php.net I have come up with the following, but it is probably rubbish!:

function sortdtr($a,$<img src='http://forums.phpfreaks.com/public/style_emoticons/default/cool.png' class='bbc_emoticon' alt='B)' />{
$a = explode('x^',$a);
$b = explode('x^',$<img src='http://forums.phpfreaks.com/public/style_emoticons/default/cool.png' class='bbc_emoticon' alt='B)' />;
if($a==$<img src='http://forums.phpfreaks.com/public/style_emoticons/default/cool.png' class='bbc_emoticon' alt='B)' />{ return 0; }
else if($a>$<img src='http://forums.phpfreaks.com/public/style_emoticons/default/cool.png' class='bbc_emoticon' alt='B)' />{ return -1;}
else if($a<$<img src='http://forums.phpfreaks.com/public/style_emoticons/default/cool.png' class='bbc_emoticon' alt='B)' />{ return 1; }

}

usort($dtr, "sortdtr");
echo "<br/>";
print_r($dtr);

In Topic: Sort Array By Values

19 November 2012 - 01:06 PM

But what would the function be?

In Topic: Sort Array By Values

19 November 2012 - 01:00 PM

I havent got a solution but I can change the values so that x is x^1 and a constant is x^0. This might make it easier, all I need to know is how to order based on the value after "x^"

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

AlphaBit.com