check if includes numbers php

PHP
$var_num = "1";
$var_str = "Hello World";

var_dump( is_numeric($var_num), is_numeric($var_str) );

/* 
Output -
 bool(true)
 bool(false)
*/if (preg_match('~[0-9]+~', $string)) {
    echo 'string with numbers';
}

Source

Also in PHP: