How to mathematically check user input: does the number match one of a given sequence: 1, 10, 100, ..., 10,000,000 in PHP. Check with preg_match () is not a problem, but somehow it is not correct to check the numbers with the function intended to check strings.
if (!preg_match('/^10{0,7}$/', $_GET['insert_number'])) { echo 'число должно быть 1, 10, 100, 1000 и т.д.'; } How to call a sequence of numbers 1, 10, ... so that the error message is more informative?