배열 정렬
페이지 정보
작성자 MintState 댓글 0건 조회 11,885회 작성일 08-11-03 11:31본문
배열 정렬
<?php
$s = explode("|","4|5|7|1|2");
$m = array(
"0" => "a",
"1" => "b",
"2" => "c",
"3" => "d",
"4" => "e",
"5" => "f",
"6" => "g"
);
for ($i=0; $i < count($s); $i++) {
$p[$m[$i]] = $s[$i];
}
asort($p);
print_r($p);
echo "<BR />";
while (list($key,$val) = each($p)) {
echo $key;
}
?>|
|
댓글목록
등록된 댓글이 없습니다.





배열 정렬