I have a JS variable that I have sent to PHP on the same page using ajax - (this is in a function in script tags at the bottom of the body on my php file)
$.ajax(