Skip to content

String Functions

PHP provides many built-in functions for working with strings.

Common string functions include:

  • strlen()
  • strpos()
  • substr()
  • str_replace()
$text = "Hello World";
echo strlen($text);
echo strpos("Hello World", "World");