or
how does code behind the [ url=http://somewhere] thing on this site work?
i have a content management system,
which uses templates with tags to mark where the page content should be inserted.
the tags look like this:
Code: Select all
{:tag:}so i might have a text file template that goes
Code: Select all
html to set up layout etc,{:menu:}...more layout..{:text:}Code: Select all
<?php
// tags with the format {:tagName:} are replaced with: $text
$template = str_replace("{:".$tagName.":}", $text, $template);
?>Code: Select all
<?php
//clean unused tags
$template = preg_replace("/{:.*?:}/", "",$template);
?>Code: Select all
{:tag optionalInformation:}when i post to this message board there is a feature
that allows me to make a link by going [ url=http://somewhere]somewhere[/url]
i imagine there a gazillion ways to find the [ url] tags in a string and extract the information after the (optional) = sign,
but i was wondering if anyone has an opinion on the best way to do it.
how does this message board do it?
cheers
thanks for you help,
mat