How do I output the array element according to incomplete name?

There is such a framework:
hi\hi, glad to see you!\1
how are things\Things are great!\1
I'm a man\I robot))\1
who are you\I'm bot!\1

there is a handler :
<?php
if($_GET['method'] == "add"){
 $fp=fopen("base.bin","a"); 
 fwrite($fp, "\r\n" . $_GET['vop'].'\\'.$_GET['otv'].'\\1'); 
fclose($fp);
}else{
$str = file_get_contents("base.bin");
$arr = explode("\n", $str);
$questions_arr = array();
foreach($arr as $question)
{
 $tmp = explode('\\', $question);
 if(!isset($questions_arr[$tmp[0]])) {
 $questions_arr[$tmp[0]] = array();
}
 $questions_arr[$tmp[0]][] = $tmp[1];

}
array_change_key_case($questions_arr);
$input_text = $_GET['text'];
$input_text = mb_strtolower($input_text);
$answer = $questions_arr[$input_text][rand(0, count($questions_arr[$input_text])-1)];
$sys = array(
'Creator name' =--> '%creator_name%',
);
$answer = str_ireplace("%sys%", json_encode($sys), $answer);
if($answer == ""){
 $answer = "Shaw";
}
echo $answer;
}
?>

Need a check for a partial match, like if you say it's a man, it must be a coincidence and brought to 'I robot))'
June 14th 19 at 20:27
1 answer
June 14th 19 at 20:29
Solution
mb_stripos()

PS: or if incomplete: stumper.ru
stumper.ru on request "Boomer" gives a Hummer. :) - Giles_Luettgen18 commented on June 14th 19 at 20:32
well, not perfect yet) - Kyleigh_Hills commented on June 14th 19 at 20:35
If it's your service, just wondering what similarities it computes a "Boomer" <=> "bmw". In General, cool theme, can be used. - Giles_Luettgen18 commented on June 14th 19 at 20:38
the dictionary of synonyms, jargon and local dialects)
PS: are there other options?) - Kyleigh_Hills commented on June 14th 19 at 20:41
The question is, "How" and "What"? I mean what is the similarity of strings? - Giles_Luettgen18 commented on June 14th 19 at 20:44
well , so you can test on the form (link in the demo below the input field) - Kyleigh_Hills commented on June 14th 19 at 20:47

Find more questions by tags PHP