-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.php
More file actions
47 lines (41 loc) · 965 Bytes
/
example.php
File metadata and controls
47 lines (41 loc) · 965 Bytes
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
<?php
include 'src/ErzhConvert.php';
use axiref\HanziConvert\Erzh;
if (!isset($_GET['str'])) {
die('请在URL后跟随str参数,仅支持简体字');
}
$res = Erzh::convert($_GET['str']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>二简字转换</title>
</head>
<body>
<div class="content">
<h3><?=$_GET['str']?></h3>
<hr>
<?php foreach ($res as $key => $value): ?>
<?php if ($value['type'] == Erzh::ERZH): ?>
<img class="erzh" src="<?=$value['url']?>">
<?php else: ?>
<?=$value['str']?>
<?php endif ?>
<?php endforeach ?>
</div>
<style type="text/css">
.content .erzh
{
width: 1em;
position: relative;
top: .18em;
}
.content
{
font-size: 1.8em;
font-weight: 200;
}
</style>
</body>
</html>