Escape user input before preg_replace You are here: Free PHP » Snippets » Escape user input before preg_replace Sometimes you need to do preg_replace on user input. Don't forget to escape all special characters or you'll get funny results. Published on: Tuesday - 29 September 2015 Categories: Snippets Tags: rss , snippets Comments are closed.