PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php function find_text($text) { $text = strtolower($text); $dict = [ "kde" => "Nikde", "kam" => "Nikam", "kdy" => "Nikdy", "jak" => "Nevim", "co" => "Nic", "proč" => "Nevim", "proc" => "Nevim", "kdo" => "Nikdo", "koho" => "Nikoho", ]; foreach($dict as $find=>$return) { if (false !== strpos($text, $find)) { return $return; } } $text = array("Spíš ne", "Asi", "No nevím"); return $text[array_rand($text)]; }; echo find_text('"Kdy prijdes"'); if(isset($_GET['action'])) { $text = $_POST['textbox']; } ?>
Show:  
Copy Clear