Validating only alphabetic characters by ctype_alpha

bool ctype_alpha(string $input_string)
By using ctype_alpha function in php we can check or validate alphabetic characters only. Using this function we can check any input coming from insecure ( or any other ) sources. This function is case insensitive so can't differentiate between lower case and upper case alphabetic characters. Here is the syntax of this function.

Now let us try with some examples.
echo " This is alphabetic ";
echo "this is not alphabetic";
By changing the value of $var you can check this function.
We can check user input from a form for presence of alphabets only, here is the sample code.
echo " This is alphabetic ";
}else{ echo "this is not alphabetic";}
To check only alphanumeric characters we can use ctype_alnum function.

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2023 All rights reserved worldwide Privacy Policy Disclaimer