Dvielis Posted May 2, 2006 Report Share Posted May 2, 2006 (edited) Piem lai ar BB kodu noboldotu textu taisa šādi - $text = preg_replace("#\[b\](.+?)\[/b\]#is", "<b>\\1</b>", $text); a kā panākt šādu variantu? teksts , lai krāsas vietā red, es varētu rakstīt jebkādu krāsu! Edited May 2, 2006 by Dvielis Link to comment Share on other sites More sharing options...
v3rb0 Posted May 2, 2006 Report Share Posted May 2, 2006 pēc līdzības ar to kā dabū boldu $text = preg_replace("#\[color\=(.+)\](.+?)\[/color\]#is", "<font color="\\1">\\2</font>", $text); Link to comment Share on other sites More sharing options...
Dvielis Posted May 2, 2006 Author Report Share Posted May 2, 2006 Jap, tas šancē, tikai vajadzēja vienu ? zīmīti pielikt ;) $text = preg_replace("#\[color\=(.+?)\](.+?)\[/color\]#is", "<font color="\\1">\\2</font>", $text); Bet kā to pašu varētu vēl panākt, lai varētu postā iekopēt PHP kodu? Link to comment Share on other sites More sharing options...
Dvielis Posted May 2, 2006 Author Report Share Posted May 2, 2006 AAa, izdomāju =) $text = preg_replace("#\[code\](.+?)\[/code\]#is", "<code>\\1</code>", $text); Link to comment Share on other sites More sharing options...
bubu Posted May 2, 2006 Report Share Posted May 2, 2006 Atkal pa zvirbuļiem ar lielgabalu... $text=str_replace(array("[CODE]", "[ /CODE]"), array("<code>", "</code>"), $text); Link to comment Share on other sites More sharing options...
Recommended Posts