click here to open sidebar
Php string – It is sequence of characters.
“Hello, how are you” is a string.
Data type are give below.
This function return the length of the string
for example “Hello”, Hello string length is 5 (count the letter).
strlen()
It is use for count the word of given string.
For example: “Welcome to my website”. output: 4 (four word in given sentence)
string word count
Search the text within the string.
It function search the repeat text and give the position of the text. If match not found, it will return false.
strpos() function
It is use for reverse the string.
strrev() function
It is use for replace the text with some other text in given string.
str_replace() function