ERROR with filter_var

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bubble
Forum Newbie
Posts: 5
Joined: Wed May 28, 2008 8:43 am

ERROR with filter_var

Post by bubble »

hi guys, need help again, why filter_var cannot run in my comp

this is the script(just simple script)

Code: Select all

<?php
$email = "someone@exa mple.com";
 
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
 {
 echo "E-mail is not valid";
 }
else
 {
 echo "E-mail is valid";
 }
?>
and the error :
Fatal error: Call to undefined function: filter_var() in C:\......

can someone help me?
thx
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: ERROR with filter_var

Post by onion2k »

I would imagine you don't have the PECL filter package installed. Instructions for installing it are on the filter_var page in the PHP manual.
bubble
Forum Newbie
Posts: 5
Joined: Wed May 28, 2008 8:43 am

Re: ERROR with filter_var

Post by bubble »

i've read the manual, but it's so complicated to me, can you make a simple description how to install it?

btw does any hosting already installed this function????

tq
Post Reply