You’d grab the letter using the HTTP GET method, where the query string within the URI would contain the letter to search for, such as [b]http://domain.tld/page.php?letter=a[/b]
Using the $_GET super global, you could then validate the user input:
if(preg_match('#^[a-z]{1}$#i', $_GET['letter'])) {
$letter = strtolower($_GET['letter']); // valid input
}else{
$letter = 'a'; // default value for invalid input
}
And then depending upon where the data is coming from (a database, file, or elsewhere?), you’ll need to take the input and use it to filter the word list you have.
If it’s from a database, then you could execute a query like the following:
$q = "SELECT word FROM relation WHERE word LIKE '{$letter}%'";
If it’s from a file (which should be loaded into an array) or from an array within your PHP code, then you could use something like the following: