| 
 Posted by J.O. Aho on 05/29/06 22:18 
Tommy DN wrote: 
> I just wanted to make something that creates html-code which should be  
> inserted in a mysql database. 
>  
> The user should type text in a textarea. When the user submits the data,  
> all enters should be translated into "<br>" and it would be nice if the  
> user could also insert links ( "<a href="..." ) in the formular. 
 
new line to <br> is easily done with nl2br() 
http://www.php.net/manual/en/function.nl2br.php 
 
For urls you will most likely need to make your own function that uses regexp,  
there are a number of functions you can use to transform a web-address into a  
anchor. 
http://www.php.net/manual-lookup.php?pattern=regexp&lang=en 
 
 
 
  //Aho
 
  
Navigation:
[Reply to this message] 
 |