I have a question about how to test whether a variable (or string) has letters in it. I want to make this if statement so only a numerical value will "pass the test"
<?php
$article=$_GET["article"];
$test=$article;
//$tarticles is grabbed from text file.
if($test<0 || $test>$tarticles || $test=="")
{
$article="articles";
}; ?>
So when it is a value that is less than zero or greater then $tarticles or when there is no value set, it will set $article, so that it returns the list of articles instead of a certain article. Right now the if function works for everything, except if the value contains a number first and then any combination of letters or numbers. If it is all numbers or a letter first then whatever, it works. Just not when there is a number first. So, my question is... what can I add to make sure there are no letters in it?