PHP 썸네일형 리스트형 배열에 재귀로 함수 실행하기 public static function recursionFuntion($data, $arrDepth = 1) { return array_map(function ($item) use ($arrDepth) { if (is_array($item) === true) { //하위배열 유무 체크 $arrDepth++; $item = self::recursionFuntion($item, $arrDepth); } elseif (gettype($item) === 'string' || gettype($item) === 'integer') { //문자나 숫자면 실행 $item = htmlspecialchars_decode($item); } return $item; }, $data); } 더보기 이전 1 다음