Skip to content

Instantly share code, notes, and snippets.

@nielslange
Last active April 5, 2019 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielslange/ac768c56e8fd593ae8f4acd4ab9ab9f2 to your computer and use it in GitHub Desktop.
Save nielslange/ac768c56e8fd593ae8f4acd4ab9ab9f2 to your computer and use it in GitHub Desktop.
Check if a string only contains letters
<?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