ashleek007 Posted May 24, 2007 Share Posted May 24, 2007 hi all, I'm trying to strip these \\\\ out of a variable... i know how to strip the white spaces here: - <?php $str = 'foo o'; $str = preg_replace('/\s\s+/', ' ', $str); // This will be 'foo o' now echo $str; ?> But i need to strip these backslashes... Any ideas, Cheers, Ash Link to comment https://forums.phpfreaks.com/topic/52800-solved-stripping-backslashes-using-preg_replace/ Share on other sites More sharing options...
ashleek007 Posted May 24, 2007 Author Share Posted May 24, 2007 <?php $str = 'foo\\\o'; $str = preg_replace('/\\\/', '', $str); echo $str; ?> Sorry just found the code... im stupid... cheers, Ash Link to comment https://forums.phpfreaks.com/topic/52800-solved-stripping-backslashes-using-preg_replace/#findComment-260678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.