str_word_count() 函数计算字符串中的单词数.
语法:str_word_count(string,return,char)
参数 描述
string 必需,规定要检查的字符串.
return 可选,规定 str_word_count() 函数的返回值.
可能的值:0 - 默认,返回找到的单词的数目,1 - 返回包含字符串中的单词的数组,2 - 返回一个数组,其中的键是单词在字符串中的位置,值是实际的单词.
return 可选,规定被认定为单词的特殊字符,该参数是 php 5.1 中新加的,代码如下:
$str="hello world"; //定义字符串 $result=str_word_count($str); //查找单词个数 echo $result; //输出的结果 echo "<br>"; $result=str_word_count($str,1); //返回数组 print_r($result); //输出结果数组
文章网址:
随意转载^^但请附上教程地址。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools
