[ create a new paste ] login | about

Link: http://codepad.org/M2Jw9KQJ    [ raw code | output | fork | 3 comments ]

PHP, pasted on Dec 12:
1
2
3
4
5
<?php
$_SESSION['content'] = "This should be a \r\n\r\nNew line";
echo(nl2br($_SESSION['content']));

?>


Output:
1
2
3
This should be a <br />
<br />
New line


Create a new paste based on this one


Comments:
posted by richard.ellis.braithwaite on Dec 12
<?php
$content = 'This is a\r\n\r\nnew line';
echo $content;

$old = array('\r','\n');
$new = array('',"\n");
$output = str_replace($old,$new,$content);
echo $output;
?>
reply
posted by prakashtest on Sep 13
testing

work

new line

comment
reply
posted by prakashtest on Sep 13
wdwsf
sfsf

sfsf
reply