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.

you should read manual.

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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -