the more robust, and IMHO proper, way to look at this is, as dkdude implies, that Javascript will only operate on the client side, and PHP will only operate on the server side. However, there are multiple ways for the two to "interact".
one way is like dkdude implies, that javascript, or simply HTML <a> tag clicking, can send a request via the browser to the server php script, and based on any number of factors, including script name, or parameters passed, the script can determine which PHP function to execute.
AJAX (asynchronous javascript and xml) is another example of a more complicated, but in some ways, more elegant, way to look at your problem.
Basically, the premise is that you would have Javascript make a background call (not a full page refresh like the previous example) to a PHP script, and again, give it some info about what function to execute. the difference would be that the PHP script would transparently return it's results to your javascript, which could then decide what to do with it (display it, parse it, etc).
one way that i've seen things like this implemented is in special PHP scripts which take a set of your PHP functions (or class objects) and automatically outputs dynamically created javascript that will, using AJAX methods, have basically stub functions in your javascript with the same name as the corresponding PHP functions/object methods. In that way, you simple call the function in Javascript, and it takes care of bridging the gap and sending that call to PHP, which executes the appropriate function, and returns the result to your javascript function, which then gives it back to you.
While complicated and not for the faint-of-heart, this is the closest we can come to giving you a solution that is really robust and extensible, and thus most likely to be useable for whatever it is you are trying to do.
Check out this package for an example of what i'm talking about: