I have a bunch of textareas that I am currently using ckeditor on, and storing the values in a database. When I get these values back, I want to be able to tell if nothing was entered into a particular textarea. The problem however is that ckeditor likes to put its own markup and other things into the string even if that textarea was not touched.
So, I need to be able to remove all spaces, line breaks, and html breaks from the beginning and end of a string (since we do not want to erase the good data). Here are the strings I am currently trying to trim (var_dumped from an array),
array(3) {
["remediation"]=>
string(26) "
But not the third
"
["effective"]=>
string(28) "
Second one is blank
"
["celebrate"]=>
string(6) "
"
}
I have already tried the following: trim, this preg replace, and a number of variations of that preg_replace.
in it which needs to go away also. – Metropolis Sep 21 '12 at 22:08