View Full Version : Converting to VB Script
KingOfHeart
06-16-2008, 04:49 PM
I want to convert some tags into VB style. I can easily convert "<b>" to "[b]" using str_replace.
What I need help with are the image and weblinks
I need to convert both ways
<a href = "whatever.com">testing</a> to testing (whatever.com)
This is a little trickier because someone might create a broken tag, and if it creates a broken html link, that will produce errors.
KingOfHeart
06-17-2008, 09:42 PM
Anyone know how to use the preg_match/all function?
I think this might help with my problem.
Susmita
06-21-2008, 05:32 AM
preg_match is a PHP function . Aren't you using VB Script?
In VB you may use a combination of InStr and Mid
Or you could replace "<a href" with "[a href" and "</a>" with "[/a]"
KingOfHeart
06-21-2008, 07:55 PM
No, I'm creating this in PHP.
I called it VB because in forums you type [b] and [u], etc.
I'm now thinking maybe it's a str_replace function combined with an explode.
xsaviorx1
12-06-2008, 08:52 AM
preg_match is a PHP function . Aren't you using VB Script?
In VB you may use a combination of InStr and Mid
Or you could replace "<a href" with "[a href" and "</a>" with "[/a]"
__________________________________________________ ________
thanks for the information!!!!
nayes84
04-18-2009, 12:43 AM
there is a perl script in the following link to do the work for you
HTML To BB Code Converter (http://www.garyshood.com/htmltobb/)
you can use it like it is or you can just pick up the regular expressions and use with preg_match to make your own php code