2
가능한 중복 :
php - get numeric index of associative arrayPHP 연관 배열에서 위치를 얻는 방법?
$array = ('a'=>'a', 'b'=>'b');
foreach($array as $key => $value){
//echo $position (1,2)
}
나는 간단한 함수와 배열의 위치를 얻을 수 있습니까?
당신은 $ ++ 에코'프로그램을 사용하여 코드 한 줄을 건너 뛸 수 있습니다;'. 자세한 정보는 [Incrementing/Decrementing Operators] (http://php.net/manual/en/language.operators.increment.php)를 참조하십시오. – Treffynnon