I'm able to get rid of all
,
, ,
, PHP_EOL
, and \t
pieces from a string. I've also found (I think) most of the whitespace-related special characters: 	
,
,
,  
,  
, and for kicks ¶
and ¶
which should mean the same thing, but I was running out of things to try.
However, when I process the string, there's still a newline from time to time. There doesn't seem to be a trend. Is there a special character or something else missing from this list that would leave a newline in a textarea
?
Newlines before and after the ones left are removed, and the script's thorough on the first round by ensuring it never breaks out of its loop until there aren't any changes. As a guarantee-test, I tried str_replace
on all of the above and it didn't change anything.
When I copy and paste the string into a doc with hidden characters enabled, it displays a paragraph symbol in those places, but copying/pasting that character into the script as a replacement didn't work, either.
So, what's missing?
Edited to add
and
Edit:
The problem with adding code is that it's spread out and based on an array that gets cycled through. The below is a straightforward bit that (Now) removes 'all' instances in a string. It looks like adding
and
fixes it in the 'replace all,' but didn't in my circumstance-driven script, so I'll have to figure that one out. At least I know what I was missing now. :)
$this->keys = array("
", "
", "", "
", PHP_EOL);
str_ireplace($this->keys, "", $this->formatted);
str_ireplace(array("\t", "	", " ", " ", "¶", "¶", " ", " "), "", $this->decodeHTML($this->formatted));