Read carefully the entries for file() and split() in the manual.
file() will pull your pseudo-database into an array, with each element corresponding to one record.
To chop each record up into its constituent components, use split(), which returns yet another array. This is easy, since you've used pipes to delimit the subrecords.
For each line in the first array, split it up. Now you can refer to the components in a line that prints out a formatted result. In your case you're interested only in element 0, but you might want to use other elements as well.
Something like this:
$myfile = file('mydata.txt');
for ($i = 0; i < sizeof($myfile); $i++){
$data = split('|', $myfile[$i]);
$number = $i+1; // arrays are zero-based!
echo "<a href=\"list.html?number=$number\">$data[0]</a><br>";
}
I have no idea why you're passing a parameter to an HTML page. You probably should be pointing to a separate PHP page that pulls the details from the same dataset.