PHP addslashes() Function4 Sept 2024 | 1 min read PHP addslashes() function is used to return a quote string with slashes. It works with some characters:
Syntax:
Example 1Output: Your string is :What does "WHO" mean? By using addslashes() function the result isWhat does \"WHO\" mean? Example 2Output: Who's the father of PHP? This is not safe in a database query. Who\'s the father of PHP? This is safe in a database query. Example 3Output: Wow' PHP? A use case of addslashes() is escaping the abovementioned characters in a string that is to be evaluated by PHP:Example 4Output: Is The Father of PHP\'Rasmus? Next TopicPHP String |
PHP string Function PHP string is in-built function. It is used to parse the string into variables. Syntax: parse_str(string,array); Parameter Description Required/Optional String Specify the string to parse required Array Specify the name of an array to store the variables. optional Example 1 <?php parse_str("name=John&age=26",$yourArray); print_r($yourArray); ?> Output: Array ( [name] => John [age] => 26 ) Example 2 <?php parse_str("name=John&age=26"); echo "Your Name:".$name."<br>"; echo "Your Age:".$age; ?> Output: Your Name:John Your...
1 min read
PHP string Function The string function is in-built function of PHP. It is used to set local information. It returns the new current locale and False if the locale functionality is not implemented. Note: It returns value depends on the system. Syntax: Setlocale(constant,location); Parameter Description Required/Optional constant Specify the local information to be...
1 min read
PHP Function The function in-built string function of PHP. It is used to compare string by using a natural algorithm. Syntax: int strnatcmp ( string $str1 , string $str2 ) Parameter Description Required/Optional string1 required string2 required This function : returns: <0 if str1 is less than str2; returns : >0 if str1 is greater...
1 min read
PHP Function PHP is string function. It is used to convert HTML entities to characters. The string function is the opposite of htmlentities(). Syntax: html_entity_decode(string,flags,character-set) Parameter Description Required/Optional string Specify the string to decode required flags Specify how to handle quotes and which document type to use. Optional Example 1 <?php $str = '<a href="https://www.javatpoint.com/">JavaTpoint.com</a>'; echo html_entity_decode($str); ?> Output: JavaTpoint.com Example 2 <?php print_r...
1 min read
PHP string Function The is predefined PHP string function. It is used to returns a hashed string by using DES, Blowfish, or MD5 algorithms. Following are some constants of function [CRYPT_STD_DES] [CRYPT_EXT_DES] [CRYPT_MD5] [CRYPT_BLOWFISH] [CRYPT_SHA_256] [CRYPT_SHA_512] etc. Syntax: string crypt ( string $str [, string $salt ] ); Parameter Description Required/Optional str Specify the string to be hashed required salt Specify...
1 min read
PHP Hebrev() Function PHP is string function, which is used to convert Hebrew text from right to left or left to right visual text. Syntax: hebrev(string,maxcharline) ; Parameter Description Required/Optional string A Hebrew text. required maxcharline Specify maximum character for each line. optional Example 1 <?php echo hebrev("? ???? ?????"); ?> Output: ??????? ?????? ??? TopicPHP String ...
1 min read
PHP string Function PHP string_tags() is predefine string function of PHP. It is used to strip HTML and PHP tags from a string or strips a string from HTML, XML and PHP tags. Note 1: This function is binary safe. It return a string with all NULL...
1 min read
PHP Function The function is predefine string function of PHP. It is used to search a string for any of the specified characters or search a string for any of a set of character. Note: This function is case-sensitive. Syntax: strpbrk(string,charlist); Parameter Description Required/Optional string Specify the string...
1 min read
PHP Function The function is predefined function of PHP. It is used to find the length of string or returns the length of a string including all the whitespaces and special character. Syntax: strlen(string); Parameter Description Required/Optional String Specify the string to check. Required. Example 1 <?php $str = 'Javatpoint'; echo "Your String is:".$str; echo "<br>"; echo "By using...
1 min read
PHP Function The is predefine string function of PHP. It is used to find the position of the last occurrence of a string inside another string. Syntax: Strripos(string,find,start); Parameter Description Required/Optional String Specify the string to search. Required Find Specify he string to find. Required Start Specify where to begin the search. Optional The function returns the position of...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India