분류
php
HTML을 일반 텍스트 형식으로 변환하는 PHP 구성 요소
본문
https://github.com/soundasleep/html2text
html2text는 DOM 메소드를 사용하여 HTML을 브라우저에서 렌더링되는 것과 유사한 형식으로 변환하는 아주 간단한 스크립트입니다
예제:
HTML 문서
<html> <title>Ignored Title</title> <body> <h1>Hello, World!</h1> <p>This is some e-mail content. Even though it has whitespace and newlines, the e-mail converter will handle it correctly. <p>Even mismatched tags.</p> <div>A div</div> <div>Another div</div> <div>A div<div>within a div</div></div> <a href="http://foo.com">A link</a> </body> </html>
변환후
Hello, World!
This is some e-mail content. Even though it has whitespace and newlines, the e-mail converter will handle it correctly.
Even mismatched tags.
A div
Another div
A div
within a div
[A link](http://foo.com)
- 이전글간단한 HTML5, YouTube 및 Vimeo 플레이어 19.02.23
- 다음글PHP mailer solution 19.02.23