PHP 字符串的空格数计算,该怎么解决

WBOY
Release: 2016-06-13 13:44:05
Original
1384 people have browsed it

PHP 字符串的空格数计算
我想计算我一长串字符串的空格数的数量 该如何操作呢???

------解决方案--------------------

PHP code

$string = 'afsj sakjfa adfas sakjf';
$res    = count_chars($string, 0);

echo    $res[32]; <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template