Found 35164 Articles for Programming

strtoupper() function in PHP

Samual Sam
Updated on 26-Dec-2019 10:06:39

8K+ Views

The strtoupper() function is used to convert all the characters of a string to uppercase. It returns a character with all the characters as uppercase.Syntaxstrtoupper(str)Parametersstr − The string to convert. Required.ReturnThe strtoupper() function returns a character with all the characters as uppercase.ExampleThe following is an example − Live DemoOutputThe following is the output −LAPTOP

strtolower() function in PHP

Arjun Thakur
Updated on 24-Jun-2020 13:51:38

581 Views

The strtolower() function is used to convert all the characters of a string to lowercase. It returns a character with all the characters as lowercase.Syntaxstrtolower(str)Parametersstr − The string to convert. Required.ReturnThe strtolower() function returns a character with all the characters as lowercase.ExampleThe following is an example − Live DemoOutputsolaris

strtok() function in PHP

karthikeya Boyini
Updated on 26-Dec-2019 09:43:34

181 Views

The strtok() function is a tokenize string. It returns a string token.Syntaxstrtok(str, split)Parametersstr − The string to splitsplit − Specifies one or more split charactersReturnThe strtok() function returns a string token.ExampleThe following is an example − Live DemoOutputThe following is the output −Thisisit!

strstr() function in PHP

George John
Updated on 30-Jul-2019 22:30:23

232 Views

The strstr() function is used to find the first occurrence of a string. Note − The function is case-sensitive. Syntax strstr(str, search, before) Parameters str − The string to search search − The string to search for before − A boolean value whose default is "false". If set to "true", it returns the part of the string before the first occurrence of the search parameter. Return The strstr() function returns the rest of string or false if the string is not found. Example The following is an example − Live Demo ... Read More

strspn() function in PHP

Samual Sam
Updated on 26-Dec-2019 09:42:04

44 Views

The strspn() function returns number of characters found in the string from the charlist parameter.Syntaxstrspn(str,charlist,begin,len)Parametersstr − The string to searchcharlist − The characters to findbegin − Where to begin in the stringlen − Length of the stringReturnThe strspn() function returns number of characters found in the string from the charlist parameter. It returns false if string is not found.ExampleThe following is an example − Live DemoOutputThe following is the output −0

strripos() function in PHP

Chandu yadav
Updated on 30-Jul-2019 22:30:23

74 Views

The strripos() function is used find the position of the last occurrence of a string inside the another string. Note − The function is case-insensitive. Syntax striipos(str, find, begin) Parameters str − The string to search. Required. find − The string to find. Required. begin − Where to begin the search. Optional. Return The strripos() function returns the position of first occurrence of a string inside another string or else false if string is not found. Example The following is an example − Live Demo Output 8

strrev() function in PHP

karthikeya Boyini
Updated on 26-Dec-2019 09:41:16

186 Views

The strrev() function is used to reverse a string. It returns the reversed string.Syntaxstrrev(str)Parametersstr − The string to be reversedReturnThe strrev() function returns the reversed string.ExampleThe following is an example − Live DemoOutputThe following is the output −kcaJExampleLet us see another example − Live DemoOutputThe following is the output −7387

strrchr() function in PHP

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

105 Views

The strrchr() function is used to find the last occurrence of a character in a string. Syntax strrchr(str, char) Parameters str − The string to search char − The character to find in the string. If char contains more than one character, then only the first is used. Return The strrchr() function returns all characters from the last occurrence of a string within another string, to the end of the main string. It returns FALSE if the character is not found. Example The following is an example − Live Demo Output web

strpos() function in PHP

Samual Sam
Updated on 26-Dec-2019 09:22:34

251 Views

The strpos() function is used to find the position of first occurrence of a string inside another string.Syntaxstrpos(str, find, begin)Parametersstr − The string to searchfind − The string to findbegin − Where to begin the searchReturnThe strpos() function returns the position of first occurrence of a string inside another string or else false if string is not found.ExampleThe following is an example − Live DemoOutputThe following is the output −8ExampleLet us see another example − Live DemoOutputThe following is the output −4

strpbrk() function in PHP

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

155 Views

The strpbrk() function is used to search a string for a specific character. Syntax strpbrk(str, charlist) Parameters str − The string to search charlist − The characters to find Return The strpbrk() function returns a string starting from the character found, or false if it is not found. Example The following is an example − Live Demo Output yalam Example

Advertisements