I need to be able to see if a form input in PHP is numeric. If it is not numeric, the website should redirect. I have tried is_numeric() but it does not seem to work.
Code examples will be nice.
I am developing a shopping cart that accepts an interger value for the quantity. I am trying this:
if(!is_numeric($quantity)){
//redirect($data['referurl']."/badinput");
echo "is not numeric";
}