Keleth
09-07-2011, 08:43 PM
I was just working with a string that I needed to break on new lines into array values (used preg_split for it), and initially, I just broke on \n, which actually lead to the artifact of having a hidden \r remaining I didn't notice. Upon echoing the variables, I saw a space, and wondered how it got in there. After a bit of thought, I realized that was the \r I couldn't see.
I know I could have used trim to get rid of the problem in the first place, but I'm curious: is there a way to have new characters show up? I tried addslashes to no avail. There are ways to avoid the issue of course, but just for my own information, I'm wondering if anyone has a method I could use?
I know I could have used trim to get rid of the problem in the first place, but I'm curious: is there a way to have new characters show up? I tried addslashes to no avail. There are ways to avoid the issue of course, but just for my own information, I'm wondering if anyone has a method I could use?