what is nl2br?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
How can we register the variables into a Session?
7 Answers HCL, Star Computers, Trikon Networks,
How to get the IP address of the client/user in PHP?
What is the maximum size of a database in mysql?
Will a comparison of an integer 12 and a string "13" work in php?
Is java is better than php?
Give small demo of writting OOP in PHP-mysql.
What is use of preg_replace in php?
What is the output of the following php code?
What is stripslashes php?
How check submit button is clicked in php?
What is php session id?
Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?