note 74320 deleted from ref.array by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: wmakend at intershop dot de 

----

if you want to sort array like this one
$aInt = array('1','2','3','4');
and you to have somethings like this 
1 --- 2
1 --- 3
1 --- 4
2 --- 3
2 --- 4
3 --- 4

you can do this like with 

$NumInt = count($aInt); 
for($j=0; $j<=$NumInt-1; $j++){        
        $first = $aInt[$j]; 
            for ($i=1; $i<=$NumInt-1-$j; $i++) { 
                echo $first." --- ".$aInt[$i+$j]."<br>"; 
            }      
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.