galexcd 0 Report post Posted October 24, 2006 I must be a total noob, or just really tired...............-.- either way, I cannot understand what exactly those funky strings preg_replace wants for the pattern.Could sombody explain to me exactly what the pattern string and the replace string in preg replace does?I get str_replace... that's quite basic.I considered myself a pro at php until tonight........haha shows how much i know. I bet tomorow, if i look it up I'll get it....Anyway.. any help? Thanks..... Share this post Link to post Share on other sites
electron 0 Report post Posted October 24, 2006 It needs a regular expression as a pattern.If you dont know that what are regular expressions it is quite simple to leasrn it. Just google it out OR go visit the php.net site where they have explained the whole function in details and read the comments below.That help alot and have links to some great PHP related regular expressions.But if you are using preg_replace to takecare of HTML tags or BBCODE it is useless.Hope that helps Share this post Link to post Share on other sites
galexcd 0 Report post Posted October 24, 2006 Great help.. Thanks,but why is it useless for bb code? because that's the reason I wanted to know.. Right now my message boards sorta suck because I'm using str_replace fore the bbcode, It's sorta annoying how you have to put url name every time, instead of also allowing http://www.mydomain.com/.I've also got a flash chat, and stupid flash's html has to be perfect, so <b><i>text</b></i> would leave the bold modifyer on. I was hoping for a way to use preg_replace to disable bbcode within bbcode for the chat. Share this post Link to post Share on other sites
electron 0 Report post Posted October 25, 2006 Well if you are using it for URL it is fine but make sure to make it ungreedy so that it matches not the whole thing but first start and first end.Let me see if i have that for the URL stuff. Share this post Link to post Share on other sites