View Full Version : Missing PHP Functions?

06-09-2007, 09:58 PM
I'm fairly new to PHP.

I'm trying to validate PHP variables before updating a MySQL table. Mainly to establish decimal pointys, currency, etc. I've checked on the w3schools.com site and found the following refernce to using the built-in PHP filter functions. Except, when I run them, I get an error message - "Call to undefined function filter_var() in.....". It seems that I can't get any of the preloaded functions to work but any custom functions that I write do. Is there something wrong with my code or is there something wrong with my ISP's PHP installation?

Following is the code that is placed in the body of my test page:

$int = 123;
if(!filter_var($int, FILTER_VALIDATE_INT))
echo("Integer is not valid");
echo("Integer is valid");

06-09-2007, 10:08 PM
What version of php is installed?

06-09-2007, 10:12 PM
My PHPinfo shows it as Version 5.1.4

06-09-2007, 10:16 PM
It's not available until version 5.2.0


06-09-2007, 10:24 PM
I guess that explains that then. Thanks.