I have a javascript functions which returns a hash. I need to pass this hash to php to do stuff with it. Whats the best way to do that?
You could use a cookie. How the exchange takes place (AJAX, page reload, whatever) is up to you.
in PHP: see setcookie()
in JS: see document.cookie - or perhaps a JS library such as Dojo / jQuery.