...

View Full Version : Missing PHP Functions?



cruzer
06-09-2007, 08: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:



<?php
$int = 123;
if(!filter_var($int, FILTER_VALIDATE_INT))
{
echo("Integer is not valid");
}
else
{
echo("Integer is valid");
}
?>

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

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

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

http://us.php.net/manual/en/function.filter-var.php

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum