로딩
요청 처리 중입니다...

SRT 를 VTT 로 변환

 SRT 를 VTT 로 변환

SRT 파일을 입력 받아 VTT 파일로 변환 저장하는 함수를 만들어봤다. srcFile 에 SRT 파일을 입력하고 destFile 에 vtt로 저장할 파일을 지정하면된다. function convertSRTtoVTT($srcFile, $destFile){ $srtString = file_get_contents($srcFile); if(!$srtString) return false; //엔코딩 체크 if(mb_detect_encoding($srtString, 'UTF-8', true) === false) { $enc = mb_detect_encoding($srtString, array('ASCII','UTF-16LE','WINDOWS-1252','EUC-KR')); $srtString = mb_convert_encoding($srtString, "UTF-8", $enc); } //배열처리 $temp = explode("\n", $srtString); $temp = array_filte...

# SRT # VTT # 자막변환 # 파일변환

원문 링크 : SRT 를 VTT 로 변환