thehigherentity Posted November 20, 2007 Share Posted November 20, 2007 Im trying to update my BBCode function so it will check links and emails have the current beginnings eg mailto:, http:// etc What I would like to know is how i can add a function into the following so the $1 is checked my my fix_url() function. $str = ' My wbsite '; // my link $str = preg_replace('/\[url\=(.*?)\](.*?)\[\/url\]/is', '<a href="$1">$2</a>', $str); I have tried changing the code to the following and many versions of it with no luck! $str = ' My wbsite '; // my link $str = preg_replace('/\[url\=(.*?)\](.*?)\[\/url\]/is', '<a href="'.fix_url('$1').'">$2</a>', $str); If It cant be done this way could someone please point me in the right direction to another way I could do the same type of thing. Thanks in advance Quote Link to comment Share on other sites More sharing options...
btherl Posted November 20, 2007 Share Posted November 20, 2007 It's done by this function. There's some examples in the comments on that page. Quote Link to comment Share on other sites More sharing options...
thehigherentity Posted November 20, 2007 Author Share Posted November 20, 2007 Thanks a lot, I will take a look at that see if i can work it out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.