function sanitize($array) { $value = $this->_getValueMagic($field); echo "unsantized value is $value
"; //echo's correctly if (is_array($value) && array_key_exists("notArray", $array)) { $value = $value[0]; } if (array_key_exists("isLength", $array)) { $value = substr($value,0,$array["isLength"]);; } if (array_key_exists("isWholeNum", $array)) { $value = preg_replace("/([^0-9])/","",$value); $noEscape = 'yes'; } echo "sanitized value is $value
"; //echo's correctly echo "sanitized value is ". mysql_real_escape_string($value) ."
"; //echo's blank }