Using the built in PHP regex function preg_replace and property encoding the two strings you’re searching for with preg_quote you can remove all of the
Many times you’ll want to remove the meta data on user uploaded images to your website. The meta data automatically saved to the images can
This PHP function will delete all valid cookies for a domain. We’re also sanitizing the cookie variable names from invalid characters.
Using the PHP filter_var function we can test email addresses for valid format and only unicode characters. Example usage below.
Using the preg_replace function you can easily replace all characters in a string that are not alphanumeric. This can be useful for sanitizing a string
When you download software online often the publisher will also provide a file hash to make sure that the file hasn’t been modified or hacked
Both htmlentities and htmlspecialchars work the same way in that they are used to emit a string of user input that may contain raw HTML
This php class will take two strings and return a html diff of them with the <ins> and <del> html tags representing what was deleted
Needed a function to test if a date was valid in PHP. This function does that but it also requires an expected date format. Example
I needed a function to turn a string value dollar with commas into a decimal I could insert into MySQL. This function below will take