Since it's your homework, you should at least try to work out the logic yourself. Copy/pasting it from an online answer won't help you on your exams.
PHP is a server-side scripting language that generates a HTML page for your browser to read, so it's not possible to read the PHP source code.
Look at the structure of the page:
It appears to first have a header with the game name, then a form with a label, a text input and a submit button, and under the form a hyperlink to itself.
When you click the submit button with your particular value, it redirects to itself and gives a message wether your value is too low, too high or is correct (and then the amount of tries it took).
When the page loads for the first time, a session variable will be made and given a random value between 0 and 100. PHP has a simple function for this.
When you click the submit button, the page reloads, so that means the form action redirects to the same page and the game code is on that game.php page. Thus, a check must be done if the submit button was actually pressed and if a value was given with the form (if you've had PHP in class you should already know about $_POST and $_SESSION global arrays) before it can perform the game. Since there is a counter variable that increases each time you submit a number, there should be another session variable that increases everytime the game code is performed.
After this, the game logic is incredibly simple: if the user number is lower as the random number, tell the user that, else if the number is higher as the random number tell the user that, else tell the user he won and also give the number of times he needed.