Newline and PHP
Posted: Mon Nov 02, 2009 3:54 pm
So I'm trying to account for newline characters and convert them to '<br />' before storing them in the db. However, my newlines are coming in as "%A" instead of '\r' or '\n', for some reason. Calling str_replace() fixes the problem except when the new line starts with 'A'. In that case, the leading 'A' is stored as a superscript 'a' and displays in HTML as a diamond with '?' in the middle (I guess it means some unknown character). I can't get rid of it with str_replace() because of character encoding, and nl2br() just takes care of regular newline characters.
Any help would be fantastic.
Any help would be fantastic.