shedokan Posted February 7, 2008 Share Posted February 7, 2008 I have this script: <?php $real=array(0=>'t',1=>'x',2=>'v',3=>'c',4=>'b',5=>'t',6=>'x',7=>'v',8=>'c',9=>'b',10=>'t',11=>'x',12=>'v'); for($a=0;$a<=4;$a++){ for($b=0;$b<=4;$b++){ for($c=0;$c<=4;$c++){ echo $real[$a].'+' .$real[$b].'+' .$real[$c].'=' .$real[$a+$b+$c].'<br>'; } } } ?> is echoes something like: v+c+b=x v+c+x=b t+t+t=x etc. but I want for it to echo something like this: v+c+b=x t+t+t=x v+c+x=b so it will order by the result. Quote Link to comment https://forums.phpfreaks.com/topic/89903-solved-help-with-script/ Share on other sites More sharing options...
shedokan Posted February 7, 2008 Author Share Posted February 7, 2008 please. Quote Link to comment https://forums.phpfreaks.com/topic/89903-solved-help-with-script/#findComment-460854 Share on other sites More sharing options...
amites Posted February 7, 2008 Share Posted February 7, 2008 try looking up the sort function simple tutorial for it can be found here http://www.developertutorials.com/tutorials/php/sorting-array-php-051114/page1.html Quote Link to comment https://forums.phpfreaks.com/topic/89903-solved-help-with-script/#findComment-461040 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.