In this tutorial, we are going to see how to count the number of characters in a String in PHP. You can use strlen() function in PHP to find the number of a characters in a String. It also includes spaces inside the String.
How to count the number of characters in a string in PHP
<?php $str = 'Welcom to StackHowTo'; echo strlen($str); // Sortie: 21 ?>
21MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More