Reply
imitating vB code
Old 10-12-2002, 02:17 PM imitating vB code
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Does anyone have an example of the kind of thing that vb code does in forums like this. ie. Changes all instances of [ url=http://mypage.com] into < a href="http://mypage.com" >
I know it uses regular expressions and have done it in ASP using StrReplace but don't want to code it all in php if someone already has it. Thanks,
-dk
__________________
Did I help you? If so, be nice and throw me some TP
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
When You Register, These Ads Go Away!
Old 10-12-2002, 03:03 PM
ghettocars's Avatar
Defies a Status

Posts: 1,736
Name: Josh
Location: Miami, FL
hmm that would be great to know, anyone knows how?
__________________
www.goatslacker.com
ghettocars is offline
Reply With Quote
View Public Profile
 
Old 10-12-2002, 04:24 PM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Hmm.... probably not how its done by VB but you could do something like this with str_replace.

For example, on my CMS I enclose titles in [title][/title]. Then have code to change it to HTML, for example:
PHP Code:
$content=str_replace('[title]','<font face="Arial" color="#000099"><big><b>',$content); 
So to do something like the VB code, you could have:
PHP Code:
$stringname=str_replace('[ url=','<a href="',$stringname);
$stringname=str_replace(']','">',$stringname); 
There's probably a better way, though
__________________
Free Webmaster Help - Everything a webmaster needs - for free
Free-Webhosting.info - Free web hosts reviewed and rated
Web Hosting Hunt - Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile Visit david's homepage!
 
Old 10-12-2002, 07:48 PM
AhmedF's Avatar
Left for Better Places

Posts: 258
I suggest you look up and learn how to do 'regex' [regular expressions]
AhmedF is offline
Reply With Quote
View Public Profile
 
Old 10-13-2002, 04:07 AM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Alright thanks everyone. I know it has to be done with regex. Just figured I'd look and see if someone already had some code for it. Thanks anyways.
-dk
__________________
Did I help you? If so, be nice and throw me some TP
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
Reply     « Reply to imitating vB code
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13034 seconds with 12 queries