Skip to content
Advertisement

How can I do a PHP request like I already have in Python which gives me data in JSON

I have a Python script which gives me back some data in JSON. It starts a session, posts some auth data and requests data which comes back with JSON. That works fine, but can somebody help me to do this in PHP? I am sure it is possible but I am struggling to construct that.

JavaScript

Advertisement

Answer

you need to look for curl request in php. here is a example

JavaScript

you can use json decode fuction to covert into matrix and use the variables

JavaScript

you can use something like this for formatting:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement