Skip to content

Instantly share code, notes, and snippets.

@tlongren
Created December 12, 2013 19:47
Show Gist options
  • Save tlongren/7934198 to your computer and use it in GitHub Desktop.
Save tlongren/7934198 to your computer and use it in GitHub Desktop.
Simple personal API with static array and PHP
<?php
header('Content-Type: application/json');
$dob = "8/17/1983";
$json = '{
"person": {
"age": {
"years": 23,
"months": 8,
"weeks": 2,
"days": 5,
"hours": 2,
"minutes": 39,
"seconds": 59,
"milliseconds": 927
},
"location": {
"latitude": 41.8819,
"longitude": -87.6278,
"city": "Nevada",
"state": "IA"
},
"languages": {
"communication": ["English"],
"programming": ["Javascript", "HTML", "CSS", "PHP"],
"frameworks": ["WordPress", "Anchor", "LESS", "SASS", "jQuery", "PostgreSQL", "MariaDB", "MySQL"]
}
},
"identifiers": {
"image": "http://s3.amazonaws.com/bckmn/public/about/jsh.jpg",
"home_url": "http://www.bckmn.com",
"first_name": "Joshua",
"last_name": "Beckman",
"externals": [{
"name": "Twitter",
"username": "jbckmn",
"html_url": "http://twitter.com/jbckmn"
}, {
"name": "GitHub",
"username": "jbckmn",
"html_url": "http://github.com/jbckmn"
}, {
"name": "Vimeo",
"username": "bckmn",
"html_url": "http://vimeo.com/bckmn"
}, {
"name": "Tent",
"username": "bckmn",
"html_url": "http://bckmn.cupcake.io"
}]
},
"blog": {
"rss": "http://www.bckmn.com/rss.xml",
"latest": [{
"title": "Even Starker Lines",
"url": "http://www.bckmn.com/blog/even-starker-lines",
"date": "2013-12-11T04:15:28.513Z"
}]
},
"_links": {
"self": {
"href": "/api"
}
}
}';
echo $json;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment