Category: PHP

Php tutorials for beginners with example

substr_replace – PHP String Functions

Syntax : substr_replace ( string, replacement, start, length ); Description : substr_replace() function will replace text within a part of a string. As the name suggest, it works similarly as its...

Php tutorials for beginners with example

uniqid – PHP Function

Syntax : uniqid (prefix, more_entropy) ; Description : The uniqid() function generates a unique ID based on the microtime (current time in microseconds). This is an inbuilt function of PHP. ID...

Php tutorials for beginners with example 0

wordwrap – PHP String Functions

Syntax : wordwrap ( string, width, break, cut ); Description : wordwrap() function will Wraps a string to a given number of width using a string break character. Parameter : [table caption=”” width=”100%”...

Php tutorials for beginners with example 0

nl2br – PHP String Functions

Syntax : string nl2br( string , use_xhtml); Description : It is an inbuilt function of PHP. nl2br() function inserts HTML ( <br> or </ br> ) line breaks before all...

Php tutorials for beginners with example 0

number_format – PHP String Functions

Syntax : number_format ( number, decimals, decimal_point, thousands_sep); Description : number_format() function helps in formating a number (Floating number) with grouped thousands. Note : This function takes either one, two, or four...

Php tutorials for beginners with example 0

htmlspecialchars – PHP String Functions

Syntax : htmlspecialchars ( strings, flags, encoding/character-set, double_encode ); Description : htmlspecialchars() function can converts some predefined characters to HTML entities. Here is list of predefined characters. [table caption=”Predefined Characters List” max-width=”100%”...

Php tutorials for beginners with example 0

hex2bin – PHP String Functions

Syntax : string hex2bin ( string ); Description : hex2bin function will converts a string of hexadecimal values to ASCII characters. Parameter : string – This is a Required parameter. String of hexadecimal values...

Php tutorials for beginners with example 0

How to retrieve IP address in PHP

How To Get IP Address of User in PHP:- There are many reasons for obtaining IP address of the system for logging, targeting, redirecting, etc. IP information can be found...

Php tutorials for beginners with example 0

Autocommit – MySQLi Functions

Syntax :  mysqli_autocommit(connection,mode); Description : It used to turns on or off auto-committing on database modifications done by MySQL operation like  INSERT, UPDATE ,DELETE , SELECT etc. Note : This...

Php tutorials for beginners with example 0

Affected Rows – MySQLi Functions

Syntax : mysqli_affected_rows(connection); Description : It used to get the information about number of affected rows in a previous MySQL operation like  INSERT, UPDATE ,DELETE , SELECT etc. For SELECT...

Php tutorials for beginners with example 0

strip_tags – PHP String Functions

Syntax : strip_tags ( string, allowable_tags); Description : strip_tags() function will Strip HTML and PHP tags from a string. Note : HTML comments and PHP tags are also stripped. This is...

Php tutorials for beginners with example 0

strcspn – PHP String Functions

Syntax : strcspn ( string, char, start, length); Description : strcspn() function will returns the number of characters found in a string before any part of the specified characters are found....

Php tutorials for beginners with example 0

strcoll – PHP String Functions

Syntax : strcoll ( string1, string2 ); Description : strcoll() function will function compares two strings based on locale and  this comparison is case sensitive. Note : If the current locale...

Php tutorials for beginners with example 0

strcmp() – PHP String Functions

Syntax : strcmp ( string1, string2 ); Description : strcmp() function will compare two strings. This is case-sensitive function. Note : Binary safe and case-sensitive function.  Parameter : string1 – This is a...

Php tutorials for beginners with example 0

stristr – PHP String Functions

Syntax : stristr ( string, search, before_search ); Description : stristr() function will find the first occurrence of search in a string. This is case-insensitive function. Note : This function is binary-safe....

Php tutorials for beginners with example 0

strchr() – PHP String Functions

Syntax : strchr ( string, search, before_search ); Description : strchr() function will find the first occurrence of search in a string. This function is an alias of the strstr() function. Note :...

Php tutorials for beginners with example 0

strstr – PHP String Functions

Syntax : strstr ( string, search, before_search ); Description : strstr() function will find the first occurrence of search in a string Note : This function is binary-safe. Note : This function...

Php tutorials for beginners with example 0

strcasecmp – PHP String Functions

Syntax : strcasecmp ( string1, string2 ); Description : strcasecmp() function will compare two strings. Note : Binary safe case-insensitive string comparison function. Parameter : string1 – This is a Required parameter. It...

Php tutorials for beginners with example 0

str_word_count – PHP String Functions

Syntax : str_word_count (string, returnformat, characterlist ); Description : str_word_count() function will counts the number of words in a string. Parameter : string – This is a Required parameter. It is the...

Php tutorials for beginners with example 0

str_split – PHP String Functions

Syntax : str_split ( string, length ); Description : str_split() function will breaks a string into an array. Parameter : string – This is a Required parameter. It is the input string...