Can anyone help me rewrite this ms sql function into PHP as a preg_replace()? It\'s a urlencoding function, but l need to recreate it exactly for a migration project and am havi