Skip to content

Commit be40f4b

Browse files
committed
调整示例代码格式
1 parent 74bee43 commit be40f4b

File tree

1 file changed

+64
-73
lines changed

1 file changed

+64
-73
lines changed

example.php

Lines changed: 64 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,67 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml">
3-
<head>
4-
<title>MoneyConvertor Example</title>
5-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
7-
<style>
8-
9-
body{
10-
font-size: 14px;
11-
font-family: Cambria,"Tahoma", "SimSun";
12-
}
13-
table {
14-
border-collapse: collapse;
15-
border-spacing: 0;
16-
margin-bottom: 20px;
17-
}
18-
19-
table th, table td {
20-
padding: 8px;
21-
line-height: 20px;
22-
text-align: left;
23-
vertical-align: top;
24-
border: 1px solid #DDD;
25-
}
26-
</style>
27-
</head>
28-
<body>
29-
30-
<table style="min-width: 600px">
31-
<thead>
32-
<tr>
33-
<th style="text-align:left">编号</th>
34-
<th style="text-align:left">小写货币</th>
35-
<th style="text-align:left">大写货币</th>
36-
</tr>
37-
</thead>
38-
<tbody>
39-
40-
<?php
41-
ini_set("display_errors", "on");
42-
require __DIR__ .'/MoneyConvertor.php';
43-
$money = array(
44-
'1.5',
45-
'50000',
46-
65001.05,
47-
101010101011.01
48-
);
49-
50-
$moneyObj = new MoneyConvertor();
51-
52-
$output = '';
53-
54-
foreach ($money as $key => $value) {
55-
$output .= "<tr>";
56-
$output .= "<td style=\"text-align:left\">".($key+1)."</td>";
57-
$output .= "<td style=\"text-align:left\">¥ ".$value."</td>";
58-
$output .= "<td style=\"text-align:left\">人民币(大写) ".$moneyObj->convert($value)."</td>";
59-
$output .= "</tr>";
60-
}
61-
62-
echo $output;
63-
?>
64-
65-
66-
67-
68-
</tbody>
69-
</table>
70-
71-
72-
73-
74-
75-
</body>
3+
<head>
4+
<title>MoneyConvertor Example</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
7+
<style>
8+
body {
9+
font-size: 14px;
10+
font-family: Cambria, "Tahoma", "SimSun";
11+
}
12+
table {
13+
border-collapse: collapse;
14+
border-spacing: 0;
15+
margin-bottom: 20px;
16+
}
17+
18+
table th, table td {
19+
padding: 8px;
20+
line-height: 20px;
21+
text-align: left;
22+
vertical-align: top;
23+
border: 1px solid #DDD;
24+
}
25+
</style>
26+
</head>
27+
<body>
28+
29+
<table style="min-width: 600px">
30+
<thead>
31+
<tr>
32+
<th style="text-align:left">编号</th>
33+
<th style="text-align:left">小写货币</th>
34+
<th style="text-align:left">大写货币</th>
35+
</tr>
36+
</thead>
37+
<tbody>
38+
39+
<?php
40+
ini_set("display_errors", "on");
41+
require __DIR__ . '/MoneyConvertor.php';
42+
$money = array(
43+
'1.5',
44+
'50000',
45+
65001.05,
46+
101010101011.01
47+
);
48+
49+
$moneyObj = new MoneyConvertor();
50+
51+
$output = '';
52+
53+
foreach ($money as $key => $value) {
54+
$output .= "<tr>";
55+
$output .= "<td style=\"text-align:left\">" . ($key + 1) . "</td>";
56+
$output .= "<td style=\"text-align:left\">¥ " . $value . "</td>";
57+
$output .= "<td style=\"text-align:left\">人民币(大写) " . $moneyObj->convert($value) . "</td>";
58+
$output .= "</tr>";
59+
}
60+
61+
echo $output;
62+
?>
63+
</tbody>
64+
</table>
65+
66+
</body>
7667
</html>

0 commit comments

Comments
 (0)