append and prepend script with apache

Sometimes we need to run a script in our localhost (or maybe in production) but we don’t want to edit our application to test the current environment. To solve this problem we can just add the file via apache virtual host configuration. So go on and edit your virtual host, and add this line to

sanitize php strings

Simple function to help you sanitizing the php string. This function will remove any non alphanumeric character. [cc_php] function sanitize($string) { return preg_replace(“/[^[:alnum:]]/ui”, ”, $string); } [/cc_php] example: [cc_php] echo sanitize(‘café’); /* => café / echo sanitize(‘|c/(!=)a f é’); / => café */ [/cc_php]