| Author |
HTML To ASCII and Back
|
|
| Viruss 2004-05-28, 7:31 am |
| I am now creating a message board and when the user types in a message and
pushes enter the board will not add the <br> for me. What I want to know is
simply this. Is there a function that will take the raw text and add stuff
like <br> or will I have to write a set of functions that will do this. Any
help would be great thanks.
| |
| Alvaro G Vicario 2004-05-28, 7:31 am |
| *** Viruss wrote/escribió (Fri, 28 May 2004 10:26:52 GMT):
> I am now creating a message board and when the user types in a message and
> pushes enter the board will not add the <br> for me. What I want to know is
> simply this. Is there a function that will take the raw text and add stuff
> like <br> or will I have to write a set of functions that will do this. Any
> help would be great thanks.
Check:
nl2br()
htmlspecialchars()
htmlentities()
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
| |
| Shane Lahey 2004-05-28, 11:32 am |
| On Fri, 28 May 2004 10:26:52 GMT, "Viruss" <viruss@shaw.ca> wrote:
>I am now creating a message board and when the user types in a message and
>pushes enter the board will not add the <br> for me. What I want to know is
>simply this. Is there a function that will take the raw text and add stuff
>like <br> or will I have to write a set of functions that will do this. Any
>help would be great thanks.
>
yes there is (kind of)
example:
<?php
$string = "my string is <this> & that\n";
$string = HTMLEntities( $string ); // change & to & etc....
$string = nl2br( $string ); // change newlines to <br />
echo $string . "\n";
?>
#### will produce ####
my string is <this> & that<br />
|
|
|
|