0

how to remove a single quote ' in the search string...since it would generate an error if single quote is included...

example, in an input box, the search string below are typed

'computer
computer'
'c'o'm'p'u't'e'r


if search button is click it would generate an error...


please help..thanks...

5
Contributors
5
Replies
8
Views
6 Years
Discussion Span
Last Post by lloydsbackyard
0

You can try

$clean_string = str_replace("'","",$search_string);

parameter 1, is what you are searching for, param 2 is what to replace it with, (in this case replace a single ' with nothing) and param 3 is the string you are searching through.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.