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

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -