What is the usage of the PHP strlen function?

The strlen function is used to obtain the length of a string. Its syntax is:

Find the length of a string and return it as an integer.

$string is the string to get the length of, and the return value is an integer that represents the length of the string.

Example:

In the example above, the length of the string “Hello World!” is 12 characters, so the output result is 12.

bannerAds