In this post, I have created one user defined function to remove all HTML tags from the string data of MySQL Server.
There are certain requirements like, store HTML document into the text column, but unfortunately it also contains HTML tags which required to remove.
I have found one user defined function to remove all HTML Tags from the given string.
CREATE FUNCTION fn_RemoveHTMLTag (HtmlString text) RETURNS text
DECLARE StartTag, EndTag INT DEFAULT 1;
SET StartTag = LOCATE("<", HtmlString, StartTag);
IF (!StartTag) THEN
SET EndTag = LOCATE(">", HtmlString, StartTag);
IF (!EndTag) THEN
SET EndTag = StartTag;
SET HtmlString = INSERT(HtmlString, StartTag, EndTag - StartTag + 1, "");
SELECT fn_RemoveHTMLTag('<html><body> This <i> is </i> a <b>Database</b> Research and <u>Development </u> </body></html>');
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.