Skip to content

Instantly share code, notes, and snippets.

@KaduNovoK
Created July 10, 2014 19:58
Show Gist options
  • Save KaduNovoK/025ac74232b921ed136b to your computer and use it in GitHub Desktop.
Save KaduNovoK/025ac74232b921ed136b to your computer and use it in GitHub Desktop.
Proxy and json reader files.
<?php
$url = "http://localhost/labs/0100/02.php?url=http://ip.jsontest.com/";
$jsonContent = file_get_contents($url);
$jsonObject = json_decode($jsonContent);
var_dump($jsonObject);
echo($jsonObject->ip);
<?php
$url = $_GET['url'];
$jsonContent = file_get_contents($url);
$jsonObject = json_decode($jsonContent);
echo(json_encode($jsonObject));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment