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 https://forums.phpfreaks.com/topic/174749-solved-can-removing-slashes-be-stopped/ 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 https://forums.phpfreaks.com/topic/174749-solved-can-removing-slashes-be-stopped/#findComment-920927 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 https://forums.phpfreaks.com/topic/174749-solved-can-removing-slashes-be-stopped/#findComment-920930 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 https://forums.phpfreaks.com/topic/174749-solved-can-removing-slashes-be-stopped/#findComment-920933 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 https://forums.phpfreaks.com/topic/174749-solved-can-removing-slashes-be-stopped/#findComment-920968 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.