Kotak teks hanya harus menerima alfanumerik bukan karakter khusus dalam php

if(ctype_alnum($string)){
    echo "Yes, It's an alphanumeric string/text";
}
else{
    echo "No, It's not an alphanumeric string/text";
}
Ankur