function ............(.....) { if (preg_match("/слово_1 (.*?) слово_2/siU", file_get_contents("............."), $matches)) { $text = $matches[1]; } else { $text = 0; } return $text; }