!Rei120 Posted September 16, 2009 at 10:42 PM Report Share #287394 Posted September 16, 2009 at 10:42 PM Boa noite. Estou com uma duvida. E digamos que nao percebo desta parte como queria. Precissava que me fizessem uma script para verificar se o valor de $varia contem só numeros caso sim returnar um true caso nao False E o mesmo mas para letras... Será que alguem me consegue fazer umas linhas disso? Link to comment Share on other sites More sharing options...
infopc Posted September 17, 2009 at 02:46 AM Report Share #287405 Posted September 17, 2009 at 02:46 AM if (is_numeric($str)){ //$str so tem numeros }else{ //$str tem numeros e letras } ou entao if(preg_match('[a-zA-Z]+', $str)){ //so letras }elseif(preg_match('[0-9]+', $str){ só numeros }else{ //alphanumerico } O que não tem solução, solucionado esta... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now