大家好,我还是新手,我希望有人能完成这个简单的代码。我错过了会议,所以我的猜测信件留下来,一些简单的计数器显示nuber的trys离开。 Ty先进。
<html>
<head>
<title>Pogodi rijec!</title>
</head>
<body>
<?php
session_start();
$str = strtolower("Avion");
$arr1 = str_split($str);
$brojslova = count($arr1);
$slovo = $_POST["slovo"];
$skrivenoPolje = array();
for ($i=0; $i < $brojslova; $i++) {
$skrivenoPolje[$i] = "_";
for ($j=0; $j < $brojslova; $j++) {
if ($slovo == $arr1[$j]) {
$skrivenoPolje[$j] = $slovo;
}
}}
print_r($skrivenoPolje);
print_r($arr1);
print_r($brojslova);
?>
<form action="vjesala.php" method="POST">
<p>Unesi slovo</p>
<input type="text" name="slovo">
<input type="submit">
</form>
</body>
</html>