Hello, I want to create history for some text. I have textarea and when user submit the form I want to check if there were any changes in the text, and only if yes then save the new text. The problem is that I don't want that every ENTER (<br />) will be considered as new version. only if new letters was written than it will consider as new text. I'm using some text editor for my textarea field so every enter is new paragraph = "<p></p>" How should I deal with this issue? Thank you all in avanced, Roi.
You can do that with the strip_tags() function. This way you will only check the text without the tags.
Yes strip_tags will do the job, although you might want to save formatting changes to the text. You could try just str_replace() <p> and </p> tags in the comparison, then if the formatting is changed (i.e. bold, underline etc) it'll still be recognised as a change and updated.