php - How to check if the server is in production or development environment? -
i refer this question regarding checking of server's environment php. why remote_addr
being used instead of server_addr
when checking whether server in production environment or development environment? sorry, confused here because thought remote_addr
refers client's ip address. better use server_addr
or there other reason why remote_addr
chosen?
- the
server_addr
returns ip address of server under current script executing. - the
remote_addr
returns ip address user viewing current page.
assume below script running on server..
<?php echo $_server['server_addr']; echo $_server['remote_addr'];
the first line prints server's ip address (this not change unless move script other server). second line prints ip address of user viewing page.(this changing different users connected different pcs)
Comments
Post a Comment