I need to write some PHP code inside a Javascript\'s \"document.write()\". This is a dummy example, but in the future Javascript will generate automatically tha
document.write()
What you ask is not possible. Javascript generates the php code client side, after the server is finished. The server never sees the PHP code.