How To Escape Special Characters In PHP

Today i will discuss how to remove special characters list array from string with help of str_replace() function.Normally programmer are using regular expression to remove special character from string with help of preg_replace() method, preg_replace() method is very id the special character is fixed,if escape character is configurable from config file then its very difficult that time you need to below method to escape characters from string.

Simple Example to Escape special characters in PHP

Result:

escape characters