PHP is handled server-side. You don’t need to worry about that 😛
HTML is client side and can’t be obfuscated because the client won’t be able to read it.
As for JS, I would recommend something like this.
EDIT: As for seeing if the code is running on an okay domain, use