I'm doing a school assignment where we need to "translate" the input in the textarea to the pre-written words in the arrays. I don't know how to make the choosen language radio array to search for the language array.
HTML
<html>
<head>
<title>
Translation PHP
</title>
</head>
<body>
<h1>Input your word and select the language you want to translate to.</h1>
<form action="form.php" method="GET/POST">
<p>Input your word for translation:</p>
<input type="text" name="inputword">
<p>Select language to translate to:</p>
<input type="radio" name="language" value="Swedish">Swedish<br>
<input type="radio" name="language" value="Italian">Italian<br>
<input type="radio" name="language" value="Spanish">Spanish<br>
<input type="radio" name="language" value="German">German<br>
<input type="radio" name="language" value="French">French<br>
<input type="submit" name="translate" value="Translate"/>
</form>
<br>
<p>Words available: Hello, Apple, Fruit, Car, Cat, Dog, Shoes, House, School, Sweatshirt</p>
</body>
</html>
PHP
<?php
$TranslateWord = $_GET['inputword'];
$choosenLanguage = $_GET['language'];
$English = array("Hello","Apple","Fruit","Car","Cat","Dog","Shoes","House","School","Sweatshirt");
$German = array("Hallo","Apfel","Obst","Wagen","Katze","Hund","Schuhe","Haus","Schule","Sweatshirt" );
$Swedish = array("Hej","Äpple","Frukt","Bil","Katt","Hund","Skor","Hus","Skola","Tröja");
$Italian = array("Ciao","Mela","Frutta","Macchina","Gatto","Cane","Scarpe","Casa","Scuola","Maglione");
$Spanish = array("Hola","Manzana","Fruta","Auto","Gato","Pero","Casa","Zapatos","Colegio","Sueter");
$French = array("Bonjour","Pomme","Fruit","Auto","Chat","Chien","Loger","Chaussures","l'ecole","Chandail");
$positionWord = array_search($TranslateWord, $English);
//This is where I need the language array to be found by the positionWord and choosen language radio in the form.
?>
If there is anything that I've done anything wrong in the steps before please tell me so I can learn how to improve. I've tried creating arrays within arrays but that just gives me more errors.