PHP, 29 Bytes ============= <!-- language: lang-php --> <?=strlen($argn)-($argn<"0"); string length minus boolean string is lower then string `"0"` [Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVdI1NTE2MjQwNDI0MjYxMTVTsuayt/tvY29bXFKUk5qnAVamqQuhbZQMlDSt//8HAA "PHP – TIO Nexus") PHP, 32 Bytes ------------- <!-- language: lang-php --> <?=preg_match_all("#\d#",$argn); [Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVTJQsuayt/tvY29bUJSaHp@bWJKcEZ@Yk6OhpByToqykA1amaf3/PwA "PHP – TIO Nexus") Regex count all digits or <!-- language: lang-php --> <?=!$argn^(1+log10(abs($argn))); [Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVTJQsuayt/tvY2@rCBaJ0zDUzslPNzTQSEwq1gALaWpqWv//DwA "PHP – TIO Nexus") For the case of zero as Input the expression gives back the result `1^-INF` gives back 1 cause the second expression is interpreted as false. The better way is to replace `^` with `?:` and use the ternary operator 35 Bytes -------- <!-- language: lang-php --> <?=strlen($argn)-strspn($argn,"-"); [Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVTJQsuayt/tvY29bXFKUk5qnARbX1AXyigugPB0lXSVN6///AQ "PHP – TIO Nexus") string length minus count `-` [strspn][1] [1]: http://php.net/manual/en/function.strspn.php