MaritimeSource
asked on
processing line breaks: html text area to database to xml: ^M
Hi,
I have an adhoc cms system, where the user types in content into a text area. Then I save it to a mysql db. Then I have a script which pulls from the DB and inserts into an xml file using php DOM XML functions (php 4). The problem is, in the xml file the line breaks are coming out like so:
^M
I should convert these when I pull it from the database, but before I write it to the xml. THe question is, what character code is this and what character code do I replace it with?
Thanks
I have an adhoc cms system, where the user types in content into a text area. Then I save it to a mysql db. Then I have a script which pulls from the DB and inserts into an xml file using php DOM XML functions (php 4). The problem is, in the xml file the line breaks are coming out like so:
^M
I should convert these when I pull it from the database, but before I write it to the xml. THe question is, what character code is this and what character code do I replace it with?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are correct. Unix only uses one of the chars, but Microsoft uses two chars.
Well Carriage return is to go back to the start (left side) horizontally and linefeed to go to the next line. I guess this carried over from something in computer history.
I would try getting rid of the 10 and see if it works. I assume you are displaying this on a Unix/linux machine and that is why it is a problem.
The <BR> in HTML is platform independent, but I understand why you don't want to fool with it.
Well Carriage return is to go back to the start (left side) horizontally and linefeed to go to the next line. I guess this carried over from something in computer history.
I would try getting rid of the 10 and see if it works. I assume you are displaying this on a Unix/linux machine and that is why it is a problem.
The <BR> in HTML is platform independent, but I understand why you don't want to fool with it.
ASKER
Why would microsoft ever do such a thing anyway??? DOH