Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dos to unix file problem ^M characters

Status
Not open for further replies.

richardko

Programmer
Jun 20, 2006
127
US
Hi,
I have a page where clients can upload contents from either microsoft word or other word processor into a text box. The system I am running the server is linux so all the end of line characters get converted to ^M (its not carat , its ctrl+V+M )
Is there a php command that can remove this

There is a php.ini which will remove it if we are reading from a file but if someone does copy and paste how do I remove it?

Thanks
ro
 
No, that won't work. It must be:

str_replace([red]"[/red]\r\n[red]"[/red], [red]"[/red]\n[red]"[/red], $subject)

\n and \r are only interpolated into <newline> and <carriage return> (respectively) inside doublequotes.



Want the best answers? Ask the best questions! TANSTAAFL!
 
absolutely right, thanks. I'm not used to the location of the double quotes on a mac keyboard yet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top