PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
If you want to be able to execute server side code in client side printed event handlers, use .NET. Aside from that, you will need to write some client side code (Javascript) to handle the events that you are attaching to your client side output (HTML). If you want PHP to handle something when a link is clicked, you will need to translate that click into a server request (either a GET or POST request) which, when it hits the server, PHP can do what you tell it to with that request and provide an appropriate server response.
What you are asking for at the moment is not an option in PHP as PHP processes on the server, not in the browser.
FYI, most of this thread was built around the idea that you were trying to execute PHP code through client interaction. You even posted an example in which you show a click event in an anchor tag. Essentially the context of this thread centered on the ability to call a PHP function by clicking on text in the browser. That is, by its very nature, client side.