There are a thousand different ways to do that. You can use a MySQL database as the source of the lines of text... but in your example, you are using an array which will accomplish the same thing.
But you should be passing in a variable like this:
<a href="page.php?x=one">test</a>
<?php
$var1 = array("one" => "text for one","two" => "text for two");
// This receives the value for "x" that was passed in the URL
// and puts it in a variable called $number
$number = $_GET['x'] ;
echo "$var1[$number]";
?>
<a href="page.php?x=two">test</a>