Use strlen function

The strlen() function counts the number of string used in the variable value.

Example:

[php]<?php
echo strlen("Hello world!");
?> [/php]

The code will generate a result.

12

The strlen() function has counted the number of the string including the space between the two words. The final output is 12.

Related Posts

Leave a Reply