S
S
SteepNET2021-08-05 14:44:38
PHP
SteepNET, 2021-08-05 14:44:38

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;
}


You just need to output $var, $var2, $var3 to separate files and take these values ​​from them...
Something like I haven't tried everything doesn't work out =(
Please help...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question