Pg escape functions for PHP 5.3.