Created
December 12, 2013 19:47
-
-
Save tlongren/7934198 to your computer and use it in GitHub Desktop.
Simple personal API with static array and PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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