Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何截断整个单词?_Php - Fatal编程技术网

Php 如何截断整个单词?

Php 如何截断整个单词?,php,Php,可能的重复项: 例如: PHP是一种广泛使用的通用脚本语言,特别适合Web开发,可以嵌入到HTML中。如果您是PHP新手,希望了解它的工作原理 只应显示其中的一部分 我使用了substr()函数,但结果可能是PHP是一个广泛使用的通用目的。如何将输出截断为一个完整的单词,而不是一个单词的一部分?您可以使用PHP的函数 string wordwrap ( string $str ,int $width string $break = "\n",bool $cut = false) 您可以使用

可能的重复项:

例如:

PHP是一种广泛使用的通用脚本语言,特别适合Web开发,可以嵌入到HTML中。如果您是PHP新手,希望了解它的工作原理

只应显示其中的一部分

我使用了
substr()
函数,但结果可能是
PHP是一个广泛使用的通用目的。如何将输出截断为一个完整的单词,而不是一个单词的一部分?

您可以使用PHP的函数

string wordwrap ( string $str ,int $width string $break = "\n",bool $cut = false)
您可以使用PHP的函数

string wordwrap ( string $str ,int $width string $break = "\n",bool $cut = false)

这是一个严肃的问题吗?”因为它看起来很像自动生成的垃圾邮件..还有更多。提问前请使用搜索功能。这是一个严肃的问题吗?”因为它看起来很像自动生成的垃圾邮件..还有更多。询问前请使用搜索功能。