PHP nl_langinfo() Function

PHP nl_langinfo() Function

The nl_langinfo() function in PHP returns specific local information. This function does not work on Windows platforms.

Syntax

nl_langinfo ( int $item )

Parameter

Item(required)- This parameter specifies the  integer value of the element or the constant name of the element. .

Return

This function returns the element as a string, or FALSE if the specified item is not valid.

Example 1

 or 
) in front of each newline (\n) in a string. echo "\nAfter using the 'nl2br()' function...\nNew Sring: ".nl2br($str);  ?> 

Output

String: Hello
Example
and
Tutorial
After using the 'nl2br()' function... 
New Sring Hello
Example
and
Tutorial 

Example 2

 or 
) in front of each newline (\n) in a string. echo "\nAfter using the 'nl2br()' function...\nNew Sring: ".nl2br($str);  ?> 

Output

String: This
is
a
nl2br() example
After using the 'nl2br()' function...
New Sring: This
is
a
nl2br() example 

Example 3

 or 
) in front of each newline (\n) in a string. echo "\nAfter the nl2br() function...\n"; echo nl2br($str,false); // passed false will return
instead of
?>

Output

String: This is a
nl2br() example
After the nl2br() function...
This is a
nl2br() example