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

Hi this is amul jani here, i complied my graduation in B.com stream.. but as career i looking for PHP language.. to get shape my career. so is that possible to enter in IT world.. for me how much scope of develop my career in this field.. amul jani

0 Answers  


What is the difference between javascript and php?

0 Answers  


Will php die?

0 Answers  


What is the tags in PHP is not a valid way to begin and end a PHP code block?

0 Answers  


What are the Formatting and Printing Strings available in PHP?

0 Answers  






What will the ?getdate() function returns in PHP?

0 Answers  


<?php /** * @version 1.0 $ * @package HelloWorld * @copyright (C) 2005 Andrew Eddie * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL */ /** ensure this file is being included by a parent file */ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?> <?php $database =& JFactory::getDBO(); //$sql = 'SELECT name, username FROM #__users'; $sql="select a.id, a.title, a.introtext, a.created_by, a.created from jos_content a, jos_content_frontpage b where a.id=b.content_id and b.ordering='2'"; $database->setQuery( $sql ); $user = NULL; $user = $database->loadObject(); //echo 'Name: ' . $user->name . '<br />'; echo '<h1>' . $user->title . '</h1><br />'; //echo 'Username: ' . $user->username; echo ' ' . $user->introtext; i write this and fetch the result from the database the result is The Intranet is up and working ! Our intranet is up and working and should be accessible from both Mumbai and NOIDA. As you will notice, this template, look & feel is not in line with our corporate indentity but we chose the route of "form-follows-funtion" In the first phase, we are rolling out functionality that is critical to all of us - Policies and How-to documents. In subsequent phases, we will be launching other features. Keep watching this space for more details i want to see only 4 line of top then how this may done

0 Answers   Infovision,


What is array function in javascript?

0 Answers  


Does not want to see PHPSESSID in the url. How can be done this ?

3 Answers  


What are the advantages of PHP over HTML?

11 Answers   Infosys, Torque Infotech,


What are psrs? Choose 1 and briefly describe it?

0 Answers  


Use of Session

6 Answers  


Categories