pg_escape_string() won't cast array arguments to the "Array" string like php usually does; it returns NULL instead. The following statements all evaluate to true: <?php $a= array('foo','bar'); "$a"=='Array'; (string)$a=='Array'; ...