ArizonaJohn Posted June 11, 2009 Share Posted June 11, 2009 Hello, The code below does a great job removing single quotation marks, periods, and slashes from the variable $find. However, I would like to remove double quotation remarks as well, but if I add """ to the $illegal array, it ruins all of my PHP code. So how can I add double quotation marks to the $illegal array? Thanks in advance, John <?php $illegal = array("'", ".", "/"); $find = str_replace($illegal, '', $find); ?> Quote Link to comment https://forums.phpfreaks.com/topic/161749-solved-stripping-double-quotation-remarks-from-a-variable/ Share on other sites More sharing options...
RussellReal Posted June 11, 2009 Share Posted June 11, 2009 <?php $illegal = array("'", ".", "/","\""); $find = str_replace($illegal, '', $find); ?> Quote Link to comment https://forums.phpfreaks.com/topic/161749-solved-stripping-double-quotation-remarks-from-a-variable/#findComment-853421 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.