angel1987 Posted September 4, 2011 Share Posted September 4, 2011 I have been searching on google for a while, but i couldn't find it. So i thought may be you could direct me to some tutorial or steps if you knew. Basically, i am working on a articles directory and the big text area where the main article will be entered, i want to allow all the links (link tag) on it but not any other html tags. Currently i am using strip tags and so its cutting down the tags and all the links are being displayed naked on it. So can you please tell me how do i do it? Thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/246396-how-to-i-accept-only-tag-but-strip-all-other-html-tags/ Share on other sites More sharing options...
biggieuk Posted September 4, 2011 Share Posted September 4, 2011 Hi, Im pretty sure the strip_tags function has a second parameter that specifies the allowable tags. strip_tags("This is a<b><i>test!</i></b>","<b>"); this would strip out all tags apart from the bold. Quote Link to comment https://forums.phpfreaks.com/topic/246396-how-to-i-accept-only-tag-but-strip-all-other-html-tags/#findComment-1265295 Share on other sites More sharing options...
angel1987 Posted September 4, 2011 Author Share Posted September 4, 2011 Yes, that's correct. The second parameter takes allowed tags. It works. Thanks very much. Quote Link to comment https://forums.phpfreaks.com/topic/246396-how-to-i-accept-only-tag-but-strip-all-other-html-tags/#findComment-1265298 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.