jquery - Send data to a site to obtain a Json with php -


I'm having any problem, this is the thing that I was reading a json file with jquery, and it's good The way I was working, but now I have to read it in PHP, but this is that I am using some data to get some parts of JSON:

  Datastring = "id =" + id + "& Todos =" + false; $ .ajax ({type: "post", url: "http://www.url.com/example", data: datestring, datatype: "jason", success: function (data, textstate, jxaxhr) {< Code>  

And I did not have any problems with it, because I was sending data to the site so it gave me the information that I want, but I do not know how to do it in PHP, I was trying

  $ str = file_get_contents ('http://www.url.com/example.json'); $ json = json_decode ($ str, true) var_dump ($ Take  

And of course this site is not returning me because I am not sending data

I hope there is a way. Thanks!

You should use the curl or fsockopen if it is not current and can not be enabled (too much Rare case).

How do you do curl

  with  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -