php_beginner_83 Posted September 18, 2009 Share Posted September 18, 2009 Hi all Is there a way to stop the backslashes from being removed from my string? Any help is really appreciated...this is driving me crazy. This is my code..I need to keep the slashes. $string = 'C:\\xampp\\htdocs\\Website\\images\\'; Thank you. Quote Link to comment Share on other sites More sharing options...
Garethp Posted September 18, 2009 Share Posted September 18, 2009 <?php $string = 'C:\\xampp\\htdocs\\Website\\images\\'; $string = str_replace('\\','\\\\', $string); echo $string; ?> Quote Link to comment Share on other sites More sharing options...
RussellReal Posted September 18, 2009 Share Posted September 18, 2009 $string = addslashes('C:\\xampp\\htdocs\\Website\\images\\'); Quote Link to comment Share on other sites More sharing options...
php_beginner_83 Posted September 18, 2009 Author Share Posted September 18, 2009 Thanks much, I don't know what I'd do without ya's. Quote Link to comment Share on other sites More sharing options...
YourNameHere Posted September 18, 2009 Share Posted September 18, 2009 I guess you would have to . lol Kidding ya Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.