How about
window.location = 'whatever.php?javascriptVar=' + myJavascriptVar;
The user has to leave the page, or you can use a frameset with an invisible frame, and set the invisible frame's window.location.
Or you can POST javascript variables with a form to a PHP page that doesn't spit headers out, so the user never really goes to that page (I'd have to look that one up.) I'm not sure if it doesn't spit headers, I think it sends headers that tell the browser that there is no data to see, or something along those lines.