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 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 ??? 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; 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 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; 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
Archived
This topic is now archived and is closed to further replies.