The only operators that can operate on strings are . and .= which are for concatenation and concatenation assignment respectively. Strings can be treated as arrays i.e., individual characters can be accessed using the index values. The index value begins with zero. A character at index i can be retrieved as $str[i]. An example is given below:
$str1 = "master";
The print statement in the above code prints ‘s’.
There are several predefined functions to manipulate strings. Some of them are listed below: