shadiadiph Posted April 29, 2009 Share Posted April 29, 2009 how can i replace the quotation marks around a url for example "http:www.wesite.com/login/cgi?=asdfdfdfdfdfdfdfdf" to just http:www.wesite.com/login/cgi?=asdfdfdfdfdfdfdfdf Quote Link to comment https://forums.phpfreaks.com/topic/156061-solved-preg-replace-quotation-marks/ Share on other sites More sharing options...
premiso Posted April 29, 2009 Share Posted April 29, 2009 Why not just use str_replace ??? Quote Link to comment https://forums.phpfreaks.com/topic/156061-solved-preg-replace-quotation-marks/#findComment-821575 Share on other sites More sharing options...
shadiadiph Posted April 29, 2009 Author Share Posted April 29, 2009 i must have this wrong its not working? $search = '$link'; $replace = '"'; $mystring = ' '; $linktofollow = str_replace($search, $replace, $mystring); print $linktofollow; print $link; Quote Link to comment https://forums.phpfreaks.com/topic/156061-solved-preg-replace-quotation-marks/#findComment-821582 Share on other sites More sharing options...
mikesta707 Posted April 29, 2009 Share Posted April 29, 2009 $string = whatever; $replace = array('\"', '\"'); $to = '' $string = str_replace($replace, $to, $string); oops someone got to it first Quote Link to comment https://forums.phpfreaks.com/topic/156061-solved-preg-replace-quotation-marks/#findComment-821583 Share on other sites More sharing options...
shadiadiph Posted April 29, 2009 Author Share Posted April 29, 2009 mm ok thanks but i just fixed it using $newlink = str_replace(chr(34), " ", $link); print $newlink; Quote Link to comment https://forums.phpfreaks.com/topic/156061-solved-preg-replace-quotation-marks/#findComment-821589 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.