php 배열중에서 중복값 찾기
페이지 정보
작성자
본문
array_unique 를 통해서 중복된 값들만 찾아낼 수 있습니다.
여러 중복된 배열값들 중에서 나머지는 제거하고 중복된 값들만 출력 합니다.
$fruits = ['apple', 'banana', 'orange', 'apple', 'banana', 'orange'];
$fruits = array_unique($fruits);
print_r($fruits);
// Array ( [0] => apple [1] => banana [2] => orange )
댓글목록
등록된 댓글이 없습니다.