View Single Post
Old 07-12-2011, 07:57 PM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

stripslashes is only for back slashes only to prevent quoted strings. But there is also other text replacement functions out there. my favorites are strtr and str_replace Plus in those functions you still need to save the results in a variable or they are not going to stay.

I would do it like this:
PHP Code:
//now lets pull out the tmp data (old data)
$ctoaddtmp = file_get_contents("../DOCS/originalsLISTtmp.txt");
//now input the old data to the file
$ctoadd3 = str_replace(array('/', '\\'), '', $ctoaddtmp . $displaytext);
$myoldfile = "../DOCS/originalsLIST.txt";
file_put_contents($myoldfile, $ctoadd3);
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
Tim Dobson (07-13-2011)