THis is not a PHP question, moving to a non-PHP based board... not sure which yet.
But the answer is to just show the link, and in the href parameter of the link, you'd put:
#anchorID
Then, after you've listed all the links, the answers have a hidden link with just a "name" attribute with the proper anchorID to match the answer to the question. So in your example page, they used incremented anchors like:
q1
q2
q3
qn
Then down in the actual textual answer area, they put the proper anchorID (q1,q2,q3,qn) in the name parameter of the <a> tag.
Make sense? If not, I'd suggest reading up over here on Anchor Tags & Links.