the answer is NO - PHP and Javascript are not connected at all 🙂)) PHP runs on server side Javascript - on user side.
the only way for them to collaborate - to create Javascript code using PHP.
PHP - runs first and create a page for user, and when the user get the page from server - runs Javascript