hi guys..
i am using two bbcode tags for linking inside my site which are [bkz] [/bkz] and [bkz] [*bkz]
for this, i'm using this code..
$comment = preg_replace("#\[bkz](.*?)\[/bkz\]#ise", "'<a title=\"(bkz.\\1)\" href=\"ajaxcomsayfa.php?ara='.urlencode('\\1').'\">\\1</a>'",$comment);
$comment = preg_replace("#\[bkz](.*?)\[\*bkz\]#ise", "'<a title=\"(bkz.\\1)\" href=\"ajaxcomsayfa.php?ara='.urlencode('\\1').'\" >*</a>'",$comment);
works fine.. but now i want to convert bbcode to html.. so i used preg_replace again..
$comment = preg_replace("#(<a title=(.+?) href=(.+?) >(.+?)</a>)#is","[bkz]\\1[/bkz]",$comment);
$comment = preg_replace("#(<a title=(.+?) href=(.+?) >\*</a>)#is","[bkz]\\1[/*bkz]",$comment);
now the problem starts ... it gives the output like this IF i use $comment = striptags($comment) and both tags were used..
[bkz][bkz]test[bkz][/bkz]
if only one tag is used, nothing shows up 🙁(
else it gives tags plus the html codes and drives me NUTS !!!!
please if anyone know how to get rid of this problem, let me know !!!
basicly what i want is:
<a title="(bkz.test)" href="ajaxcomsayfa.php?ara=test">test</a> TO -> [bkz]test[/bkz]
<a title="(bkz.test)" href="ajaxcomsayfa.php?ara=test"></a> TO -> [bkz]test[bkz]
pleasee help 🙁
thx for ur time
happy coding