I am using ckeditor for all my textarea in a web based game, when i type into the textarea and click the submit button it saves to my database but the database also includes the tags like <p> and <b>.
How could I remove them?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ck-editor is for saving HTML, so it is saving it in your DB. If you want to save only the text then there is no need to use ck-editor, because it is for formatted text. However if you want to use it, then the correct way is to pass through the function
http://php.net/manual/en/function.html-entity-decode.php before saving to database and when retrieve it, pass through the function http://php.net/manual/en/function.htmlentities.php and then put it in ckeditor then you can edit it or put where you are displaying it in a page.
And if you want to strip tags then use this function php.net/manual/en/function.strip-tags.php but in this case you will lose the text format.