Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this questionI have a url where json is being dynamically loaded. I need to use php to pull in that json and use json_decode to get the info out of it. So far I have not been able to figure out how to get the actual json into my php. What is it that I need to do? Is there a "content" command for php?
Right now I'm trying:
print(json_decode('http://theurl开发者_如何学JAVA.com'));
echo json_decode(file_get_contents('http://theurl.com'));
You can also use cURL instead of file_get_contents
for some extra speed and control, but it's relatively complicated to compared to file_get_contents
, especially if you've never used it before.
精彩评论