Skip to content

Instantly share code, notes, and snippets.

@tyshantprince
Created July 6, 2017 15:24
Show Gist options
  • Save tyshantprince/d46674f1804f5fd7bb34e283fd37b936 to your computer and use it in GitHub Desktop.
Save tyshantprince/d46674f1804f5fd7bb34e283fd37b936 to your computer and use it in GitHub Desktop.
<?php
$people = '{"data":[{"first_name":"jake","last_name":"bennett","age":31,"email":"jake@bennett.com","secret":"VXNlIHRoaXMgc2VjcmV0IHBocmFzZSBzb21ld2hlcmUgaW4geW91ciBjb2RlJ3MgY29tbWVudHM="},{"first_name":"jordon","last_name":"brill","age":85,"email": "jordon@brill.com","secret":"YWxidXF1ZXJxdWUuIHNub3JrZWwu"},]}';
/**
* Instructions:
*
* Given the above JSON, build a simple PHP script to import it.
*
* Your script should create two variables:
*
* - a comma-separated list of email addresses
* - the original data, sorted by age descending, with a new field on each record
* called "name" which is the first and last name joined.
*
* Please deliver your code in either a GitHub Gist or some other sort of web-hosted code snippet platform.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment