String Functions in PHP

  1. strlen()
  2. str_word_count()
  3. strrev()
  4. strpos()
  5. str_replace()

strlen():- The strlen() is a built-in function in PHP. It calculates the length of the string including all the whitespaces and special characters. It takes a string as a parameter and returns its length.

Syntax:-

strlen($string);

Example:-

<!DOCTYPE html>
<html>
<body>
<?php
$string = "expound soft tech solution";
echo strlen($string);
?> 

</body>
</html>

OUTPUT:-

sexpoundsofttechsolution
String Functions in PHP