phpllama Posted December 25, 2007 Share Posted December 25, 2007 How can I read the amount of spaces in a string?? I'm really stuck on this one ??? $string = "abc de ei ao aioin eio" Result would be 5 Quote Link to comment https://forums.phpfreaks.com/topic/83110-spaces-in-a-string/ Share on other sites More sharing options...
~n[EO]n~ Posted December 25, 2007 Share Posted December 25, 2007 <?php $string = "abc de ei ao aioin eio"; echo substr_count($string, ' '); // 5 ?> Quote Link to comment https://forums.phpfreaks.com/topic/83110-spaces-in-a-string/#findComment-422773 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.