-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.html.php
30 lines (27 loc) · 917 Bytes
/
example.html.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
<?php
require_once 'Shorten.php';
$shorten = new \Marcgoertz\Shorten\Shorten();
?>
<!doctype html>
<meta charset=utf-8>
<title>Shorten examples</title>
<p>
<?php
// provides: <a href="https://example.com/">Go to exam</a>…
print $shorten->truncateMarkup('<a href="https://example.com/">Go to example site</a>', 10);
?>
<p>
<?php
// provides: <a href="https://example.com/">Go to</a>…
print $shorten->truncateMarkup('<a href="https://example.com/">Go to example site</a>', 10, '…', false, true);
?>
<p>
<?php
// provides: <a href="https://example.com/">Go to…</a>
print $shorten->truncateMarkup('<a href="https://example.com/">Go to example site</a>', 10, '…', true, true);
?>
<p>
<?php
// provides: Lorem ipsum <b>dolor</b> sit amet
print $shorten->truncateMarkup('Lorem ipsum <b>dolor</b> sit amet', 26);
?>