Answers for "php check if number starts with 0"

PHP
0

php check if number starts with 0

Use substr function:

if (substr($str, 0, 1) == '0' || substr($str, 0, 2) == '00') {
    //=> matched
}
Posted by: Guest on June-28-2021

Code answers related to "php check if number starts with 0"

Browse Popular Code Answers by Language