G - Username Generator (Single File)

Create a Username Generator website that generates a random username by combining two words.

The website should:

  • Be created using one PHP file only
  • Store a selection of adjectives in an array
  • Store a selection of animals in a second array
  • Generate a random position for each array
  • Combine the two selected words to create a username, e.g. HappyDolphin
  • Display the generated username on the page
  • Include a Generate Username button
  • When clicked, the form should submit back to the same PHP file
  • Generate and display a new random username each time the button is clicked
$animals = array("Dolphin", "Tiger", "Panda", "Shark", "Monkey");

$random = rand(0, 4);