...

View Full Version : How do I make my own BB Code?



Jon W
10-18-2009, 09:53 AM
I wanting to make my own BB code. I'm sure a lot you already know what that is but for example. Say I want to change this string here into a url:




$string = "http://example.com";



And turn that into:





<a href="http://example.com">http://example.com</a>



What function do I use to do this with? preg_replace, str_replace?

And could someone give me a idea what are the simple ways of going about this?

er4o
10-18-2009, 11:25 AM
Yes, preg_replace will do the job :D

http://bg.php.net/manual/en/function.preg-replace.php#87944

barkermn01
10-18-2009, 11:43 AM
Yes, preg_replace will do the job :D

http://bg.php.net/manual/en/function.preg-replace.php#87944

http://www.desilva.biz/php/bbcode1.html

Just one difference dont use $GLOBALS[varname] just use $varname

Jon W
10-18-2009, 12:42 PM
Cool thanks guy. I was looking for something like this!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum