Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function people_profile() {
- $print = "gorilla test";
- $fileName = "/opt/lampp/htdocs/wordpress/wp-content/themes/black-green/bios.json";
- $people = json_decode(file_get_contents($fileName));
- //If I don't have nested objects, then this works:
- //$print .= $people->name;
- //When I do have nested objects, I can't just string pointers like this:
- $print .= $people->Person->name;
- //So, how do I get the desired effect?
- return $print;
- }
- bios.json:
- { "Person": {
- "name":"Nathan"}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement