PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $key = $_POST['key']; function translate($word) { $array = array( 'almaz' => "good", 'echo' => "php", 'html' => "css", 'sis' => "ki", 'hello' => 'привет', ); $word = strtolower($word); if (array_key_exists($word, $array)) { echo $array[$word]; } else { echo "Ключа $word не найдено."; } echo PHP_EOL; } $words = preg_split('/\W/', "Hello Html"); foreach($words as $word) { translate($word); }
Show:  
Copy Clear