note 74320 added to ref.array
| From: | wmakendatintershopdotde at osu1 dot php dot net | Date: | Thu, 05 Apr 2007 09:41:12 +0000 |
| Subject: | note 74320 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125104@lists.php.net to get a copy of this message | ||
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>";
}
}
----
Server IP: 217.160.72.57
Probable Submitter: 217.17.202.254
----
Manual Page -- http://www.php.net/manual/en/ref.array.php
Edit -- https://master.php.net/note/edit/74320
Del: integrated -- https://master.php.net/note/delete/74320/integrated
Del: useless -- https://master.php.net/note/delete/74320/useless
Del: bad code -- https://master.php.net/note/delete/74320/bad+code
Del: spam -- https://master.php.net/note/delete/74320/spam
Del: non-english -- https://master.php.net/note/delete/74320/non-english
Del: in docs -- https://master.php.net/note/delete/74320/in+docs
Del: other reasons-- https://master.php.net/note/delete/74320
Reject -- https://master.php.net/note/reject/74320
Search -- https://master.php.net/manage/user-notes.php