[PHP] 정규 표현식에 필요한 PHP함수 설명
file_get_contents($path) : 파라미터에 해당하는 파일의 내용을 읽어 리턴함 $readfile = file_get_contents($path); //파일의 내용을 읽음 $pattern = "패턴에 맞는 정규식 입력"; //readfile에서 패턴(pattern)과 일치한 부분 match에 넣음 if(preg_match_all($pattern, $readfile, $match)) { $regular = strip_tags($match[0][0]); //html 제거 $regular = preg_replace("/\s+/", " ", $regular); //모든 공백제거 echo $regular; } else { //예외 처리 : 없을경우 공백 처리 $regular = ""; } [ 자세한..