PHP is_numeric alfabetik eşdeğer

3 Cevap

Ben is_numeric alfabetik eşdeğer olacak bir işlev için arıyorum. Sadece harfler, aksi dize ve false varsa bu doğru dönecekti. Işlevi yerleşik bir PHP var mı?

3 Cevap

Eğer kesinlikle is_numeric() tersi arıyorsanız, !is_numeric() sizin için işi yapmak değil mi? Ya ben soruyu yanlış anlama ben?

Ben preg_match kullanılmış olurdu. I ctype_alpha() duymadım çünkü Ama bu.

if(!preg_match("/[^a-zA-Z]/", $teststring)) {
    echo "There are only letters in this string";
} else {
    echo "There are non-letters in this string";
}