Answer the question
In order to leave comments, you need to log in
Select one of the matches in a file in php?
You need to select one of the matches and assign a value to the variable depending on the match.
This is how it works, but you need to output the values to files
$var = '/(зарплата|зарплату|заплата|зорплата)/';
$var2 = '/(сломалось|сломалась|сломались|сломано)/';
$var3 = '/(подключиться|подключаться|подключаються|подключиться|подключится)/';
if (preg_match($var, $asr_res)) {
$ress = 1;
} elseif (preg_match($var2, $asr_res)) {
$ress = 2;
} elseif (preg_match($var3, $asr_res)) {
$ress = 3;
} else {
$ress = 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question