Hello all,
I have set a small function that allow the user to search for a specific string in my output (just simple html table).
The problem is when the user searches strings with '/' (which he often does)it brings up warning.
Warning: Unknown modifier
I've tried addslashes and strip slashes and quotemeta but with no result.
There is no problem with ''' only with '/'
any thoughts?
slashes problem
Moderator: General Moderators
you're probably using / as pattern delimiter likeif so you have to replace any / by \/ in $userInput before using it.
Code: Select all
$pattern = '/'.$userInput.'/';
...preg_match($pattern, ...