I must create a textarea and its DATA will be SAVED on mysql and then eventually SHOWN in ANOTHER .php file as HTML TEXT. Like posting messages in this forum But when you type " " or you break line HTML dont understand that it needs '&nbp'(nbsp)and '<br>', so I need to make this conversion WHEN SAVING My friend developed a function that does it BUT I'm suspecting there is an inbuild php function to that. Could someone tell if I'm right or if maybe I'M WRONG??
Newrules
the function which is built it, like you suspected is
nl2br();
eg of use.
<? $var = nl2br($_POST['var']); // where var is submitted from a form echo $var; ?>
may output something like
This Is An Example Of Using nl2br Function In Php
hth
This only converts LINE breaks HTML dont understand " " character It needs to convert TO & nbsp No idea how
$this = str_replace(" ", " ", $text2change);