Skip to content

Instantly share code, notes, and snippets.

@twogood
Created February 20, 2015 08:22
Show Gist options
  • Save twogood/8a035c3a4842dd715853 to your computer and use it in GitHub Desktop.
Save twogood/8a035c3a4842dd715853 to your computer and use it in GitHub Desktop.
Get user information from Turf API
<?php
$postdata = json_encode(array(
array('name'=>'TBIT'),
));
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/json',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$users = json_decode(file_get_contents('http://api.turfgame.com/unstable/users', false, $context));
$user = $users[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment