php - How to check if any number exists in a word -



php - How to check if any number exists in a word -

for example, if word $item = '3.5floppy' or $item = '3floppy' or $item = '4520floppy'

i want check whether number exist in word or not?

try preg_match simple, there digit or not?

if(preg_match('/(\d)/', $item)) { echo "number found!"; }

\d mean any digit

regex documentation : http://php.net/manual/en/function.preg-match.php

php

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -