PHP String nl2br() Function4 Sept 2024 | 1 min read PHP string nl2br() is predefine function which is used to insert HTML line break before all newlines in a string. It returns string with <br \> or <br> before all newlines (\r\n, \n\r, \n and \r). Syntax:
Example 1Note: Generating valid HTML markup by using 'is_xhtml' parameter.Output: Your string is: Hello .\ n PHP. \ n Javatpoint By using 'nl2br()' function: Hello . PHP. Javatpoint Example 2Output: Your string is: Welcome \ r\ n We are learning PHP By using 'nl2br()' Function: Welcome We are learning PHP Example 3Output: By using 'nl2br()' Function:This is a PHP Tutorial Next TopicPHP String |
PHP String Function The function is a built-in function of PHP, which converts a quoted-printable string to an 8-bit string. This function returns back an 8-bit binary string. The function is similar to the imap_qprint() function and opposite to the quoted_printable_encode() function. The syntax...
1 min read
PHP implode() is a string function, which joins the array elements in a string. It is a binary-safe function. In implode() function, parameters can be passed in any order. The implode() function works same as the join() function and returns a string created from the elements...
2 min read
PHP string Function PHP string is predefined function. It is used to replace some character with some other characters. It is case-insensitive version of str_replace(). Note: This function is binary-safe. Syntax: str_ireplace(find,replace,string,count); Parameter Description Required/Optional find Specify the value to find. Required replace Specify the value to replace. Required string Specify the string to be searched Required Count It is variable that...
1 min read
PHP String Function The is an in-built string function of PHP. It is used to display the array values as a formatted string according to the format. The main purpose of this function is to display a formatted string. PHP 4 and above versions supports...
3 min read
PHP string md5_file() Function PHP string md5_file() function is in-built important function. It is used to calculate the MD5 hash of a file. It uses the RSA Data Security. It returns the md5 hash on success, or FALSE on failure. Syntax: md5_file(file,raw); Parameter Description Required/Optional File Specify the file to be calculated. Required Raw Specify the Boolean...
1 min read
PHP Function The strops() is in-built function of PHP. It is used to find the position of the first occurrence of a string inside another string or substring in a string. Syntax: int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ); Parameter Description Required/Optional string Specify the...
2 min read
PHP string function PHP string function is predefined function. It is often used to remove whitespace from both sides of a string or other character from the left side of a string. Syntax: ltrim(string,charlist); Parameter Description Required/Optional String Specify the string to check. Required charlist Specify character to remove from the string. "\0" : NULL "\t" :...
1 min read
PHP String Function The is predefined PHP function. It is used to return parses input from a string according to a format. If we will pass two parameters in the function, the data will be returned as an array. Related Function: print(): It is used for output...
1 min read
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
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