Created
April 5, 2019 15:59
-
-
Save nielslange/8cebdfcd273dc257a972d1121744848e to your computer and use it in GitHub Desktop.
Check if a string only contains letters and numbers
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_alnum( $input ) ) { | |
echo $input . ' only contains letters and numbers.'; | |
} else { | |
echo $input . ' does not only contains letters and numbers.'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment