Results 1 to 1 of 1
Greetings,
I'm new to php coding so I'm trying to learn it a little at a time. Right now I'm trying to validate a variable that it contains an integer. ...
- 05-18-2011 #1Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
[SOLVED] php function filter_var
Greetings,
I'm new to php coding so I'm trying to learn it a little at a time. Right now I'm trying to validate a variable that it contains an integer. So I'm trying to use the filter_var function as follows:
The output I get is:Code:<?php $age=55; echo "Age: $age" . "<br />"; if ($age==55) echo "Right age <br />"; echo "Past <br />"; $tmp = filter_var($age, FILTER_VALIDATE_INT); echo "filter $tmp <br />"; ?>
The last echo never prints. It's like it stops execution on the function. Why?Code:Age: 55 Right age Past
Any help appreciated.
Thanks


