note 74320 deleted from ref.array by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 19:28:48 +0000 |
| Subject: | note 74320 deleted from ref.array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134525@lists.php.net to get a copy of this message | ||
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>";
}
}