<?php
function getRemoteIPAddress() {
    $ip = $_SERVER['REMOTE_ADDR'];
    return $ip;
}
PHP Peachpie Snippet remote ip address