Php string限制人物

代码示例

1
0

hwo限制char在php

echo mb_strimwidth("Hello World", 0, 10, "...");
// output: "Hello W..."
1
0

php限制串的长度

if (strlen($str) > 10)
   $str = substr($str, 0, 7) . '...';

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................