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

How do I sort numbers in php?

0 Answers  


What is basename php?

0 Answers  


Tell us what is the difference between session_unregister() and session_unset()?

0 Answers  


What is php and sql?

0 Answers  


Explain mixed and callback functions?

0 Answers  






How to get path of php.ini with a php script?

1 Answers  


How do I run a php program in dreamweaver?

0 Answers  


How does integrate SSL certificate in websites and also how to generate CSR in Local machines? plese give some ideas ASAP.....

0 Answers  


What is the definition of a session?

0 Answers  


Tell me how to initiate a session in php?

0 Answers  


Name some of the functions in php.

0 Answers  


List out the predefined classes in PHP?

11 Answers  


Categories