PHP 中的 str word count函数

首页 / PHP入门教程 / PHP 中的 str word count函数

str_word_count - 语法

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

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

Sr.No 参数 & 描述
1

string

它指定要检查的字符串

无涯教程网

链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-str-word-count.html

来源:LearnFk无涯教程网

2

return

指定String的返回值

3

char

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

str_word_count - 返回值

它返回数组或整数。

str_word_count - 示例

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

这将产生以下输出-

5

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

Android开发高手课 -〔张绍文〕

10x程序员工作法 -〔郑晔〕

Vim 实用技巧必知必会 -〔吴咏炜〕

Go 并发编程实战课 -〔晁岳攀(鸟窝)〕

陶辉的网络协议集训班02期 -〔陶辉〕

业务开发算法50讲 -〔黄清昊〕

反爬虫兵法演绎20讲 -〔DS Hunter〕

云原生架构与GitOps实战 -〔王炜〕

后端工程师的高阶面经 -〔邓明〕

好记忆不如烂笔头。留下您的足迹吧 :)