Parse HTML and replace

Hello,
can anyone help me with a script (PHP hopefully) that can parse an html page and replace the code. For instance, I want to replace <a href links with a button. Any ideas?