<?php // // error reporting (-1); $regexp = "/^7[0-9] {11}";$s = '7123h666';$i = '958678064579';if (preg_match($regexp,$s)) { echo " начинается с 7\n";} else { echo "НЕ начинается с 7\n";} if (preg_match($regexp,$i)) { echo "11 цифр\n";} else { echo "не 11 цифр\n"; }
Standard input is empty
НЕ начинается с 7 не 11 цифр
PHP Warning: preg_match(): No ending delimiter '/' found in /home/CRxm4b/prog.php on line 8 PHP Warning: preg_match(): No ending delimiter '/' found in /home/CRxm4b/prog.php on line 14
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!