fraser5002 Posted February 28, 2011 Share Posted February 28, 2011 Hi, How would i strip out both the " and ' characters from a php string? Thanks Fraser Quote Link to comment Share on other sites More sharing options...
SaMike Posted February 28, 2011 Share Posted February 28, 2011 $newString = preg_replace("/\'\"", null, $oldString) Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 28, 2011 Share Posted February 28, 2011 I'd use str_replace() <?php $str = "this string has both single quotes ' and double quotes " . '" in it'; $str = str_replace(array('"',"'"),'',$str); echo $str; ?> Ken 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.