key() 정보
기타 key()본문
key()는 현재 배열 위치에 있는 원소의 인덱스를 반환한다.
<?
$park=array("1대 미만", "1대 이상", "2대 이상");
$park_code=array("A", "B", "C");
$saved_code = "A";
reset($park_code);
while (!is_null($key = key($park_code) ) ) {
if($park_code[$key] == $saved_code{
$parking = $park[$key];
}
next($park_code);
}
echo "$parking";
?><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]</div>
<?
$park=array("1대 미만", "1대 이상", "2대 이상");
$park_code=array("A", "B", "C");
$saved_code = "A";
reset($park_code);
while (!is_null($key = key($park_code) ) ) {
if($park_code[$key] == $saved_code{
$parking = $park[$key];
}
next($park_code);
}
echo "$parking";
?><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]</div>
추천
0
0
댓글 0개