Hi Yoko,
What's the reason you want to do this?
Javascript is traditionally executed on a client computer within the Javascript interpreter of the Browser in which the page is being read.
PHP is always executed on the Web server within its PHP runtime environment.
Hence, these two operate very differently.
If I knew what it is you are trying to achieve then perhaps I could try and suggest a pure PHP solution to this rather than a mix and match solution.