First you've got to realize that javascript, is primarily a CLIENT side language, meaning it runs on a users browser. PHP, is a SERVER side language. This makes direct communication between the two inefficient.
It's still possible, but you're just bound by certain limitations. the Client (the browser) sends information to servers via requests. Thus, this is the only practical way javascript can send information. To send information, there are GET requests and POST requests. GET requests are sent via the URL. Thus, if you want to pass information to the browser, all ya gotta do is modify the URL in javascript and point the browser at the new URL.
This is probably the best way.
POST requests are sent when processing forms and they're better when handling large amounts of information. It's a little more complex to send info from javascript with a POST and i don't think you'd want to do it this way anyways.
Also, most HTTP (web) servers support sending of GET parameters (in the URL) when doing a post request.