PHP is server-side code. It runs on the server and is executed before a script is sent to the user.
JavaScript is typically used as client-side code. It runs in a user's browser and is executed after the user's browser processes the script.
You can use PHP to generate JavaScript cide, but other than that, they do not interact with each other.