There is no direct way of doing this, to my knowledge... you could try one of these:
Set the JS variable as a cookie and let PHP read it.
Place the JS variable in the query string of the PHP script.
In both cases, you need a new page load before PHP can read the variable.