
Een str_replace voor spatie?
-
-
Guest, wil je besparen op je domeinnamen? (ad)
-
-
nl2br?
-
Hoe voeg ik dat precies toe in mijn forum stukje:
PHP
Toon Meer$in = str_replace("[color=#", "[color=", $in); $patterns = array( "#\[b\](.*?)\[/b\]#si", "#\[u\](.*?)\[/u\]#si", "#\[i\](.*?)\[/i\]#si", "#\[s\](.*?)\[/s\]#si", "#\[center\](.*?)\[/center\]#si", "#\[color=(.*?)\](.*?)\[/color\]#si", "#\[size=(.*?)\](.*?)\[/size\]#si", "#\[right\](.*?)\[/right\]#si", "#\[qt=(.*?)\](.*?)\[/qt\]#si", ); $replaces = array( "<b>\\1</b>", "<u>\\1</u>", "<i>\\1</i>", "<s>\\1</s>", "<center>\\1</center>", "<font color=\"#\\1\">\\2</font>", "<font size=\"\\1\">\\2</font>", "<div style=\"text-align: right;\" align=\"right\">\\1</div>", "<table width=\"70%\" style=\"border: 1px dashed #000; max-width: 100%; margin-left: 10px; margin-top: 7px; margin-bottom:3px;\" cellspacing=\"0\"> <tr> <td class=\"inhoud\" style=\"padding: 2px;\"> <b>\\1</b> schreef:<br> \\2 </td> </tr> </table>" );
-
Nee, als je het echoed dan plaats je nl2br($var);
Waar $var staat tot de variabele.
Nu word een getypte nieuwe lijn vervangen door een HTML br (<br />)
Participate now!
Heb je nog geen account? Registreer je nu en word deel van onze community!