I wrote a simple class in php called cut html string . This class with cut the html string without considering html tags but the output will have the html tags as it is. Here I used strlen function to find the length of string. This function return the number of bytes of the string. If string has some utf8 special characters then it returns wrong value, because those special characters will take more bytes. I want to find the number of characters in the string. mb_strlen function returns the number of characters in string. A multi-byte character is counted as 1. I prefer to use mb_strlen function to find the character count of a string.
strlen vs mb_strlen function in php7 06 2009