Atur php varibe dengan penyimpanan loka javascript

 $phpvariable = "<script>document.write(localStorage.getItem('local_variable'))</script>";
Precious Pygmy