PHP is server side. So once the page is retrieved from the server, its over.
In other words, once you see the page, you cannot have PHP simply come back and add something, like this:
<a href="link" onClick="<? phpFunction(); ?>">Some link</a>
It won't happen.
You have to send something back to the server via a page refresh or a AJAX method.
I suggest using jQuery (which you can learn at http://www.jquery.com ). It is a JavaScript derivative that make asynchronous scripting easier:
$.ajax( parameters );
Other than that, no you cannot.
Good Luck!
If you need further assistance/advice, feel free to contact me.