如何在get方法中显示最近的查询

I had this form

<form action="" method="GET">
<label>NAME:</label>
<input type="text" name="name" id="name" required/>
<button>GET</button>
</form>

<?php

if (isset($_GET['name'])){

$name = $_GET['name'];

echo "hello".$name;}
?>

If entered one name "google" after that again I entered "example"

is there any way by which I can display recent entered names when I type another?

the code that i think could be enough to handle the issue would be

<?php
  if(!isset($_GET["name"]){
    print "the name parameter was not supplied";
    die();
  }
  session_start();
  $name = $_GET["name"];
  $_SESSION["list"][sizeof($_SESSION["list"])] = $name;
  var_dump($_SESSION["list"]);
  //I used var_dump here only to show the output you are free to use any other
  //way to display the data as you like