what is nl2br?

Answers were Sorted based on User's Feedback



what is nl2br?..

Answer / prantik gautam

nl2br() means newline to break. Actually when we retrieve
data from database using PHP mysql code, the nl2br()
function helps to get the format to maintain the sequence as
was at the time of insertion.

Is This Answer Correct ?    10 Yes 0 No

what is nl2br?..

Answer / rameshmjs

nl2br — Inserts HTML line breaks before all newlines in a string


Example using nl2br()
<?php
echo nl2br("foo isn't\n bar");
?>

The above example will output:

foo isn't<br />
bar

Is This Answer Correct ?    6 Yes 0 No

what is nl2br?..

Answer / madhu

nl2br is used for new for every entry
example :
<?php
mysql_connect("localhost","root","");
mysql_select_db("databasename");
$query=mysql_query("select * from table");
while($row=mysql_fetch_assoc($query)){
$var = $row['data'];
echo nl2br($var);
?>

Is This Answer Correct ?    1 Yes 0 No

what is nl2br?..

Answer / abhay

nl2br is use t for new line,\
ex:echo nl2br("this is \n ddd");

output
this is
dd

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More PHP Interview Questions

Do you know how can php and html interact?

0 Answers  


What does type casting mean in php? Explain with an example?

0 Answers  


Which function is used to read a single character from a file in PHP.

0 Answers  


Which operator is used to concatenate two strings in PHP?

0 Answers  


What are the functions to be used to get the image's properties (size, width and height)?

0 Answers  






How can we destroy the cookie?

4 Answers  


How to get seconds from current date using date function ?

8 Answers   Sarna Technologies, Satyam,


How do you match the character ^ at the beginning of the string? - ^^

1 Answers  


how can i find number of rows in a table using MS Access and php? i used odbc_num_rows($query); but it returned -1.

1 Answers  


What is the current stable version of php? What advance thing in php7?

0 Answers  


What is magic quotes?

0 Answers  


How to pass variables by references?

0 Answers  


Categories