Skip to content

Instantly share code, notes, and snippets.

@Jursdotme
Created December 19, 2014 08:07
Show Gist options
  • Save Jursdotme/8fbf5e1f20f1f3a5d2c9 to your computer and use it in GitHub Desktop.
Save Jursdotme/8fbf5e1f20f1f3a5d2c9 to your computer and use it in GitHub Desktop.
random user
<?php
$json_url = "http://api.randomuser.me/?format=json&results=10";
$json = file_get_contents($json_url);
$links = json_decode($json, TRUE);
foreach($links['results'] as $key=>$val ){
$user_image_large = $val['user']['picture']['large'];
$user_image_medium = $val['user']['picture']['medium'];
$user_image_thumbnail = $val['user']['picture']['thumbnail'];
$user_firstname = ucfirst($val['user']['name']['first']);
$user_lastname = ucfirst($val['user']['name']['last']);
$user_name = $user_firstname . ' ' . $user_lastname;
$user_title = ucfirst($val['user']['name']['title']);
$user_email = $val['user']['email'];
$user_cell = $val['user']['cell'];
?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment