2. A string is a sequence of characters,
like "Hello world!".
We will take a look at some
extended examples on PHP Strings.
What are strings?
3. What is the length of the following
string: “Suraj is cool”?
At what index does “u” start?
Write a program to find the number
of words in the line.
Reverse the string “Hello world!”.
Example 1: String Manipulation.
4. 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.
Strpos
5. The PHP str_replace() function replaces some
characters with some other characters in a string.
Replace the “word” by “hello” in the following string.
“Test Word”
Replace text within a string