/ Published in: PHP

This will strip special characters and return only what is required and very useful in search queries to avoid xss injections.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Legend for regular expression pattern used # \s - whitespace # [] - grouping # \ - escape character # \. - dot character $text = 'this>! is %#4>sample* file 01.jpg'; echo $output; #result: this is 4sample file 01.jpg
Comments
