无涯教程-PHP - str word count函数

54 阅读1分钟

str_word_count - 语法

mixed str_word_count ( string $string [, int $format=0 [, string $charlist ]] )

它返回有关字符串中使用的单词的信息

Sr.No 参数 & 描述
1

string

它指定要检查的字符串

2

return

指定String的返回值

3

char

它指定将哪些字符视为单词

str_word_count - 返回值

它返回数组或整数。

str_word_count - 示例

<?php
   echo str_word_count("tutorials point simply easy learning");
?>

这将产生以下输出-

5

参考链接

www.learnfk.com/php/php-fun…