nl2br in reverse? replace<br \>with line breaks in tex
Posted: Sun Nov 14, 2004 3:31 pm
Hi all
I've used nl2br to replace line breaks in a text area with <br /> before.
Now I'm trying to do just the opposite, and can't figure out how.
Basically I want to echo in a text field some text from an html file.
I tried the following code, using str_replace:
<?php
$fp = fopen ("text.htm", 'r');
$data = str_replace("<br />", "\n\r", $fp);
echo "$data";
?>
but this doesn't work.
Could you help me?
?>
I've used nl2br to replace line breaks in a text area with <br /> before.
Now I'm trying to do just the opposite, and can't figure out how.
Basically I want to echo in a text field some text from an html file.
I tried the following code, using str_replace:
<?php
$fp = fopen ("text.htm", 'r');
$data = str_replace("<br />", "\n\r", $fp);
echo "$data";
?>
but this doesn't work.
Could you help me?
?>