/ PHP

Previous Article

PHP Function to return your IP address

Next Article

Here's a quick little function which can be used to return your IP address

function getRemoteIPAddress() {
    $ip = $_SERVER['REMOTE_ADDR'];
    return $ip;
}

The result can be very handy when combined with an if statement to code parts of a site you don't want the end user to see. Just remember you need to know your IP address before you can create the statement below.

$ip = getRemoteIPAddress();

if ($ip == "insert your IP here") {
    //run the code only you want to see here
}
Avatar of Clive Walkden

Clive Walkden

Latest Articles

Linux

Output All Users Cron Jobs

If you want to check all users cron jobs this little command will output them to the command line

Magento 2

Magento 2 admin password history reset

Do you want to clear the password history on your staging test site (not recommended for live)?

Linux

How to see files changed on a certain date

As a sysadmin you often need to see which files have been modified on a certain date.