is_numeric burada senin işini görcektir.
if (is_numeric($sayi)) {
echo "evet sayi";
}
else {
echo "hayir degil";
}