Skip to content

Instantly share code, notes, and snippets.

@gjuric
Created May 13, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjuric/bfd337957e36b978fd15a8b1c35f8861 to your computer and use it in GitHub Desktop.
Save gjuric/bfd337957e36b978fd15a8b1c35f8861 to your computer and use it in GitHub Desktop.
IP adresa
<?php
include_once('vendor/autoload.php');
use Symfony\Component\HttpFoundation\Request;
$request = Request::createFromGlobals();
// Ako imaš proxy ispred, ovdje podesi njegov/njegove IP adrese
// $request->setTrustedProxies(['127.0.0.1']);
$ip = $request->getClientIp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment