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 |
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
What is the difference between javascript and php?
Will php die?
What is the tags in PHP is not a valid way to begin and end a PHP code block?
What are the Formatting and Printing Strings available in PHP?
What will the ?getdate() function returns in PHP?
<?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
What is array function in javascript?
Does not want to see PHPSESSID in the url. How can be done this ?
What are the advantages of PHP over HTML?
11 Answers Infosys, Torque Infotech,
What are psrs? Choose 1 and briefly describe it?
Use of Session