Category: PHP

Php tutorials for beginners with example

strtok – PHP String Functions

Syntax : string strtok ( string, token ); OR string strtok ( token ); Description : It’s an inbuilt function of PHP. strtok() function Tokenize string or we can say splits a string...

Php tutorials for beginners with example

strrev() – PHP String Functions

Syntax : string strrev ( string ); Description : It’s an inbuilt function of PHP. As its name implies, strrev() function will reverse the string. Parameter : [table caption=”” width=”100%” colwidth=”15%|15%|15%|55%”...

Php tutorials for beginners with example

strrchr() – PHP String Functions

Syntax : string strrchr ( string, char_string ); Description : strrchr() function will find the last occurrence of char_string in a string and returns all characters from this position to the end...

Php tutorials for beginners with example

strpbrk() – PHP String Functions

Syntax : string strpbrk ( string, char_list ); Description : strpbrk() function will  searches a string for any of the specified characters. Note : case-sensitive function. Parameter : [table caption=”” width=”100%”...

Php tutorials for beginners with example

strncmp() – PHP String Functions

Syntax : int strncmp ( string1, string2, length ); Description : strncmp() function will compare two strings. This is case-sensitive function. Note : Binary safe and case-sensitive function. Tip :  strncmp()  is...

Php tutorials for beginners with example

strncasecmp – PHP String Functions

Syntax : int strncasecmp ( string1, string2, length ); Description : strncasecmp() function will compare two strings. Note : Binary safe case-insensitive string comparison function. Tip : This function is similar to...

Php tutorials for beginners with example

strnatcmp – PHP String Functions

Syntax : int strnatcmp ( string1, string2 ); Description : It’s an inbuilt function of PHP. strnatcmp() function compares the two strings  using a “natural” algorithm. Note: This function is  binary-safe and...

Php tutorials for beginners with example

strnatcasecmp – PHP String Functions

Syntax : int strnatcasecmp ( string1, string2 ); Description : It’s an inbuilt function of PHP. strnatcasecmp() function compares the two strings  using a “natural” algorithm. In a natural algorithm, the...

Php tutorials for beginners with example

strlen – PHP String Functions

Syntax : int strlen ( string ); Description : It’s an inbuilt function of PHP. The strlen() function returns the length of a string. Parameter : [table caption=”” width=”100%” colwidth=”15%|15%|15%|55%” colalign=”left|left|left|left”]...

Php tutorials for beginners with example

strripos – PHP String Functions

Syntax : strripos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. strripos() function find the position of the last occurrence of a search_string in a string....

Php tutorials for beginners with example

strrpos – PHP String Functions

Syntax : strrpos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. strrpos() function  Find the position of the last occurrence of a search_string in a string....

Php tutorials for beginners with example

strpos – PHP String Functions

Syntax : strpos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. strpos() function  Find the position of the first occurrence of a search_string in a string....

Php tutorials for beginners with example

stripos – PHP String Functions

Syntax : stripos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. stripos() function find the position of the first occurrence of a search_string in a string....

Php tutorials for beginners with example 0

stripcslashes – PHP String Functions

Syntax : string stripcslashes ( string); Description : It’s an inbuilt function of PHP. stripcslashes() function un-quote string quoted with addcslashes(). Recognizes C-like \n, \r …, octal and hexadecimal representation. Note : We can use this...

Php tutorials for beginners with example 0

stripslashes – PHP String Functions

Syntax : string stripslashes ( string); Description : It’s an inbuilt function of PHP. stripslashes() function un-quote string quoted with addslashes(). Note : We can use this function to clean up data...

Php tutorials for beginners with example

substr – PHP String Functions

Syntax : substr ( string, start_position, length ); Description : It’s an inbuilt function of PHP. substr() function will return part of a string. Parameter : string – This is a Required parameter....

Php tutorials for beginners with example

strtr – PHP String Functions

String strtr ( string, from, to ); OR String strtr ( string, replace_array ); Description : It’s an inbuilt function of PHP. strtr() function translate characters or replace strings. In case if...

Php tutorials for beginners with example

substr_count – PHP String Functions

Syntax : substr_count ( string, substring, start_position, length ); Description : It’s an inbuilt function of PHP. substr_count() function counts the number of times a substring comes in a string. Note: The...

Php tutorials for beginners with example

substr_compare – PHP String Functions

Syntax : substr_compare ( string1, string2, start_position, length, case_insensitivity ); Description : It’s an inbuilt function of PHP. substr_compare() function will compares two strings from a specified start position. It do the binary...