-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.php
78 lines (65 loc) · 1.64 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
// Run on command line: php test.php
include __DIR__.'/HtmlToText.php';
$html = <<<'EOT'
<html>
<head>
<title>Some Title</title>
<style>
Some styles here
</style>
</head>
<body>
<img src="logo.png">
<h1>Hello World</h1>
<p>Lorem ipsum <b>dolor sit</b> amet, consectetur adipiscing elit. Praeteritis, inquit, gaudeo.
Dici enim <br>nihil potest verius. Duo Reges: constructio interrete. Haec para/doca illi,
nos admirabilia dicamus. Comprehensum, quod cognitum non habet? Quoniam, si dis placet?
</p>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Haec para/doca illi, nos admirabilia dicamus. Age, inquies, ista parva sunt. Suo genere perveniant ad extremum;
</p>
<table>
<thead>
<tr>
<th>Amount</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>Item #1</td>
</tr>
<tr>
<td>532</td>
<td>Item #2</td>
</tr>
<tr>
<td>0</td>
<td>Item #3</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Amount</th>
<th>Description</th>
</tr>
</tfoot>
</table>
</body>
</html>
EOT;
$htmlToText = new \NF\HtmlToText;
echo $htmlToText->convert($html);
exit;