Last active
April 5, 2019 15:56
-
-
Save nielslange/ac768c56e8fd593ae8f4acd4ab9ab9f2 to your computer and use it in GitHub Desktop.
Check if a string only contains letters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ctype_alpha( $input ) ) { | |
echo $input . ' only contains letters.'; | |
} else { | |
echo $input . ' does not only contains letters.'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment