damn darn carriage return
Posted: Mon Jun 09, 2003 9:05 am
Here's the scenario. I need to strip out any carriage returns before a field is submitted into my database. The field in question is used to populate “OverLib”(JS app used to generate pop over windows)
If there are any Carriage returns within the string given to “OverLib” the JS has a wobbly. Plus the carriage returns are untidy.
Here are my unsuccessful efforts to strip out the offending carriage returns.
Does anyone have the answer?
1. $New = str_replace('\r', '', $New);
2. $New = str_replace('\n', '', $New);
3. $New = str_replace('^M', '', $New);
4. $New = str_replace('
’, '', $New);
If there are any Carriage returns within the string given to “OverLib” the JS has a wobbly. Plus the carriage returns are untidy.
Here are my unsuccessful efforts to strip out the offending carriage returns.
Does anyone have the answer?
1. $New = str_replace('\r', '', $New);
2. $New = str_replace('\n', '', $New);
3. $New = str_replace('^M', '', $New);
4. $New = str_replace('
’, '', $New);