A string is a sequence of characters, like "Hello world!".
some commonly used functions
<?php
echo strlen("Hello world!"); // outputs 12
?>
<?php
echo str_word_count("Hello world!"); // outputs 2
?>
<?php
echo strrev("Hello world!"); // outputs !dlrow olleH
?>
The PHP strpos() function searches for a specific text within a string. If a match is found, the function returns the character position of the first match. If no match is found, it will return FALSE.
<?php
echo strpos("Hello world!", "world"); // outputs 6
?>
The first character position in a string is 0 (not 1).
<?php
echo str_replace("world", "studentsempire", "Hello world!"); // outputs Hello studentsempire!
?>