We have some kind of variable, we need to interrupt the execution of the script if there is no point in it. Here are the best practices:

$per1 = $_POST['info']; if (preg_match("/./", $per1)) { выполняем скрипт } else { стоп } 

But they do not work. Where is the mistake?

  • the point is the control character in the regulars. And any symbol will fit under it (a line feed may be appropriate if the correct flags are set). - KoVadim

1 answer 1

Instead

  '/./' 

Need to

  '/\./'