beanymanuk Posted November 2, 2011 Share Posted November 2, 2011 I have a WYSIWYG on my site and somehow the users input it in the database with this at the end <p The p tag is left open and messing up the styling on the page How can I fix it so this tag is removed or closed? Is there a php function I can use? Quote Link to comment Share on other sites More sharing options...
Adam Posted November 2, 2011 Share Posted November 2, 2011 Can you not just use a DBMS like PHPMyAdmin and change it manually? Quote Link to comment Share on other sites More sharing options...
beanymanuk Posted November 3, 2011 Author Share Posted November 3, 2011 I don't want to have to change it manually want it to automatically to prevent page layout looking wrong Quote Link to comment Share on other sites More sharing options...
Adam Posted November 4, 2011 Share Posted November 4, 2011 Check if your PHP installation has the Tidy extension installed; you could use the Tidy::cleanRepair() method to fix the broken mark-up. If not and you have root access to the web server, you can install it yourself. Otherwise you might need to use a scripted solution such as this - I can't vouch for it though. 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.