You can't.
JavaScript is client-side.
PHP is server-side.
That means:
First, the PHP code is performed by the Apache server and outputs (most commonly) any HTML and CSS and JavaScript code to the browser. By PHP it is treated simply as text. Once the PHP sent this text to the browser, it is no longer used (in this request).
Second, the browser brings these three (HTML, CSS, JavaScript) to life. It parser the HTML to the DOM, CSS to the layout and JavaScript to the live, functional scripting language.
You can pass anything you want only this way:
server-side --> client-side
The other way is obviously impossible. JavaScript can be performed on live websites by anyone. If the client --> server
traffic would be possible, anyone could mess up with data on your server.
One of the possible ways to communicate with the server without page reloading is using AJAX technology. There are plenty of resources in the Web, like this one.