Can't get carriage return to work
Posted: Wed Mar 19, 2008 5:01 pm
I'm copying chunks of text from pdf files into..
(1)HTML KIT - for minor formatting. Then gets copied to...
(2) A text area in a form which then gets....
(3) Inserted into a Mysql Database.
The PDF document obviously puts in some sort of line breaks to wrap the text. But I can't get rid of them when pulling the information from the database. And I don't want to have to manually 'backspace' all the line breaks out as I'm putting the text into the database.
Here's my code for cleaning up the text as it's being displayed.
$copy = ereg_replace("(\r\n|\n|\r)", "<br />", $copy); //replaces coded breaks with hard breaks
$copy = str_replace("'",'’',$copy); // takes out apostrophes
$copy = str_replace(chr(13)," ",$copy); // deletes carriage returns
$copy = str_replace(chr(10)," ",$copy); // deletes carriage returns
I would assume that this would do it. But it still doesn't work. My carriage returns still show up.
Using PHP5 on a windows server 2003
Does anyone have any suggestions?
(1)HTML KIT - for minor formatting. Then gets copied to...
(2) A text area in a form which then gets....
(3) Inserted into a Mysql Database.
The PDF document obviously puts in some sort of line breaks to wrap the text. But I can't get rid of them when pulling the information from the database. And I don't want to have to manually 'backspace' all the line breaks out as I'm putting the text into the database.
Here's my code for cleaning up the text as it's being displayed.
$copy = ereg_replace("(\r\n|\n|\r)", "<br />", $copy); //replaces coded breaks with hard breaks
$copy = str_replace("'",'’',$copy); // takes out apostrophes
$copy = str_replace(chr(13)," ",$copy); // deletes carriage returns
$copy = str_replace(chr(10)," ",$copy); // deletes carriage returns
I would assume that this would do it. But it still doesn't work. My carriage returns still show up.
Using PHP5 on a windows server 2003
Does anyone have any suggestions?