Page 1 of 1

Call to undefined function filter_var()

Posted: Fri Apr 04, 2008 2:42 am
by eskio
Hi, I have the following error when I tried to use filter_var() function:

Fatal error: Call to undefined function filter_var() in Url\functions.php on line 5

I want to know if I have to install a php extension before using the function?

:crazy:

Please help

Re: Call to undefined function filter_var()

Posted: Fri Apr 04, 2008 3:09 am
by EverLearning
You need Filter extension for filter_var() to work.

PHP 5.2.0 or later has Filter bundled and enabled by default. There is no need to manually install it. If you have earlier version of PHP than you'll have to install it yourself.

Re: Call to undefined function filter_var()

Posted: Fri Apr 04, 2008 3:09 am
by onion2k
You need to be using PHP 5.2.0 or later, and install the Filter PECL library. http://uk3.php.net/filter

EDIT: Beaten to it!

Re: Call to undefined function filter_var()

Posted: Fri Apr 04, 2008 3:17 am
by eskio
EverLearning wrote:You need Filter extension for filter_var() to work.

PHP 5.2.0 or later has Filter bundled and enabled by default. There is no need to manually install it. If you have earlier version of PHP than you'll have to install it yourself.

from where can I get the extension to install

Re: Call to undefined function filter_var()

Posted: Fri Apr 04, 2008 4:07 am
by EverLearning
For linux just type

Code: Select all

pecl install filter
in your console.

For windows download appropriate dll from pecl4win.php.net and add it to php.ini