• 0

[PHP] - replace a enter with <br>


Question

4 answers to this question

Recommended Posts

  • 0
i've already tried that and it didn't work because i have code in it aswell

echo nl2br("

<div align='center'>

$post

</div>

");

all it does is display nothing on the page

if $post is a variable, then:

echo "&lt;div align='center'&gt;" . nl2br($post) . "&lt;/div&gt;";

or even better, there's no need to store the div in the variable, or even parse it with php - e.g:

&lt;div align="center"&gt;
&lt;?php echo nl2br($post); ?&gt;
&lt;/div&gt;

If that's not what you mean, pastebin the source and we'll have a look (**** any passwords out obviously).

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.