Built-in Functions
Explore key built-in string functions in PHP to extract and replace substrings, find positions, calculate string length, count words, and reverse strings. This lesson builds practical skills for effective text processing and prepares you for applying these techniques in coding challenges.
Extracting or Replacing Substrings #
Single characters can be extracted using array (square brace) syntax as well as curly brace syntax. These two syntaxes will only return a single character from the string. If we need more than one character, we have to use the in-built substr function.
Note: Strings, like everything in PHP, are 0-indexed, ...