Contact: aviboots(AT)netvision.net.il
43,918 questions
57,322 answers
573 users
$str = "25"; $n = (int)$str; echo $n > 0 ? "yes" : "no"; /* run: yes */
$str = "25"; $n = (int)$str; if (is_int($n) && $n > 0 ) { echo "yes"; } else { echo "no"; } /* run: yes */
$str = "25"; if (ctype_digit($str) && (int)$str > 0 ) { echo "yes"; } else { echo "no"; } /* run: yes */