Skip to content

Commit 12cf97a

Browse files
committed
添加文档说明
1 parent 139b619 commit 12cf97a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,27 @@ echo Pinyin::pinyin('带着希望去旅行,比到达终点更美好');
9494
//获取首字母
9595
echo Pinyin::letter('带着希望去旅行,比到达终点更美好');
9696
// d z x w q l x b d d z d g m h
97+
98+
//当前也可以两个同时获取
99+
echo Pinyin::parse('带着希望去旅行,比到达终点更美好');
100+
// output:
101+
// array(
102+
// 'src' => '带着希望去旅行,比到达终点更美好',
103+
// 'pinyin' => 'dài zhe xī wàng qù lǔ xíng bǐ dào dá zhōng diǎn gèng měi hǎo',
104+
// 'letter' => 'd z x w q l x b d d z d g m h',
105+
// );
97106
```
98107

99108
## 设置
100109

101110
| 选项 | 描述 |
102111
| ------------- | --------------------------------------------------- |
103-
| `delimiter` | 分隔符,默认为一个空格 ' ' |
104-
| `traditional` | 繁体 |
105-
| `accent` | 是否输出音调 |
106-
| `letter` | 只输出首字母,或者直接使用`Pinyin::letter($string)` |
107-
| `only_chinese` | 只保留`$string`中中文部分 |
112+
| `delimiter` | 分隔符,默认为一个空格 ' ' |
113+
| `traditional` | 繁体 |
114+
| `accent` | 是否输出音调 |
115+
| `letter` | 只输出首字母,或者直接使用`Pinyin::letter($string)` |
116+
| `only_chinese` | 只保留`$string`中中文部分 |
117+
| `uppercase` | 取首字母时的大写,默认`false` |
108118

109119

110120
*全局设置:* `Pinyin::set('delimiter', '-');`

src/Pinyin/Pinyin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ public static function parse($string, array $settings = array())
170170
//add delimiter
171171
$delimitedPinyin = $instance->delimit($pinyin, $settings['delimiter']);
172172

173-
174173
$return = array(
175174
'src' => $string,
176175
'pinyin' => $instance->escape($delimitedPinyin),

0 commit comments

Comments
 (0)