ionik Posted January 20, 2008 Share Posted January 20, 2008 Hey i cant seem to find anything on this and lost the code i developed long ago for this and my memory isnt to good on it. What I'm trying to do is make a 2 functions one will read text a user inputs and find if there are any opening html tags and there atrr. If it finds html opening tags it will compare them to an array of html tags allowed to be used by the user and if not remove the unwanted tags leaving the text inside of them. And the other function will find closing html tags and compare them to the ones that are allready opened and get the text that is within the html tags and prepare it for output. Here is an example of what it would be. $text = '<span color="red">This text is red</span> This text is outside html tags'; //it will take the code and make these variables $opentags = 1; $closetags = 1; $parsetext = 'This text is outside html tags'; $parseabledata = 'This text is red'; $opentags = array('span color="red"'); $closetags = array('span'); 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.