じゃあそろそろ正解だしちゃうぞ

if (ereg("^[0-9]+$",$i)) {
print "test";
}