so far it works but there are a couple of problems i cant work out
one is when a link is submitted starting with www. it is converted with the following code to a showable link but I dont know how to make it work with the http:// on the beggining
$url = preg_replace("/\[url=(\W?)(.*?)(\W?)\](.*?)\[\/url\]/i", '<a class="bbcode_links" href="http://$2">$4</a>', $url); // change bbcode links
I know i could str_replace it out but I cant make it work on a mix of lower and upper case letters
is there a way i can work it into the above preg_replace so it would remove the http:// at the same time as changing the code over to a html link?
my other problem is white spaces
[mytags] <<<< I have many of these tag names and need the code to work on them all so like the above code recognisses the [ ] to know its a tag, i need somthing like this for removing the white space
I want a way to remove all spaces from between [ mytags ] << them tags so i would end up with [mytags]
so even if the input was [ m y t a g s ] it would still come out as [mytags] it would also be great if i could remove new lines and breaks etc from inside them tags too.
at the same time i need to fine a way of doing cind of the same thing with the text outside the tags but not all the spaces just the leading and ending space eg
[mytags] blah blah blah [/mytags] would become [mytags]blah blah blah[/mytags] i dont want to remove new lines or anything with this part though
please help it has taken me days to work out the rest and its realy not far from finnished now this is just about my last problem