How can we count space between text in PHP?
example: hi how are you? spaces: 3
Is there a way to count spaces?
Language: Only PHP
Advertisement
Answer
Use this:
substr_count($text, ' ');
How can we count space between text in PHP?
example: hi how are you? spaces: 3
Is there a way to count spaces?
Language: Only PHP
Use this:
substr_count($text, ' ');