
June 2nd, 2004
09:58 AM
Wanna-b PS Expert
Status: Offline!
Disableing "\r" parsing
Ok well I'm creating a text file using the fopen command and I have "\r"'s in the text file that have to be left alone. But i can't seem to figure out how to keep the php parser from getting rid of it.
Any way i can fix my small problem?

June 2nd, 2004
11:06 AM
thinking of something witty to put here
Status: Offline!
As in you want the text '\r' to be displayed literally?
<?php
$str = str_replace("\r", "\\\r", $str);
?>
Last edited by Rad, June 3rd, 2004 05:01 AM (Edited 1 times)

June 2nd, 2004
11:45 AM
Wanna-b PS Expert
Status: Offline!
I'll try that but i doubt it will work...since i have to write to the file...thats when it will remove the \r's

June 2nd, 2004
04:57 PM
Neversidian
Status: Offline!
try this if that doesnt work as well
str_replace('\r',"\r",$str);
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

June 3rd, 2004
05:01 AM
thinking of something witty to put here
Status: Offline!
Sorry, fixed the code. vBB screws up backslashes...

June 8th, 2004
04:28 AM
Wanna-b PS Expert
Status: Offline!
thanks! I can't believe i forgot about the double "\"'s
It works fine now 