I have a form which is posting an array which looks like this:
Array
(
[SearchForm] => Array
(
[query] => Eg: 2 Bedroom Flat Chelsea
[rent] => 1
[share] => 0
[short] => 1
[price_min] => 50
[price_max] => 100
)
[yt0] => Search
)
I want to check if the value for $_REQUEST['SearchForm']['price_min'] is not empty, and is an integer. I am using:
if (($_REQUEST['SearchForm']['price_min'] != "") && (is_int($_REQUEST['SearchForm']['price_min']))){
...
}
The is_int is returning false (the if statement is not being executed)
Any ideas why?
Because POST and GET parameters are always string, so instead of is_int use is_numeric