Sinisterly
[How To] Word Counter - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: PHP (https://sinister.li/Forum-PHP)
+--- Thread: [How To] Word Counter (/Thread-How-To-Word-Counter)



[How To] Word Counter - Banadmin - 07-17-2013

(07-17-2013, 04:03 PM)Sanctuary Wrote: Thanks guys. Smile And yeah, I read somewhere about the sterl function in PHP, it's an alternative to this.
I'll make a tutorial on how to make a Word Counter as soon as I found out how, since those have more use. Tongue

This thread has been requested by Sanctuary.

PHP Code:
<?php echo str_word_count("This line of code will display the number nine"); ?>

:tongue:


RE: [How To] Word Counter - Fhoto - 07-17-2013

Pretty simple, good for beginners I guess.


RE: [How To] Word Counter - Sanctuary - 07-18-2013

Pretty simple compared to how you would do it with jQuery, but to make it so anybody can use it, you'd need to create a variable, and assign it to the textarea/input, then have it echo out the number, and blah blah blah. Tongue
Still a nice tutorial though, and doesn't need much explanation.