如何计算php中的文本语句中的空间 [英] how to count space in a text statement in php
本文介绍了如何计算php中的文本语句中的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何计算php中的文本之间的空格?
示例:hi你好吗?
空格:3
有没有办法计算空格? p>
语言:只限PHP
解决方案
使用:
substr_count($ text,'');
how can we count space between text in php ?
example: hi how are you?
spaces: 3
is there any way to count spaces ?
Language : Only PHP
解决方案
Use this:
substr_count($text, ' ');
这篇关于如何计算php中的文本语句中的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文