Good that I did a search before implementing it myself. Because PHP has a function for (almost) everything. This time "count_chars". https://secure.php.net/manual/en/function.count-chars.php
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!