I am trying to test this feature "Get the plain text of John 3:16 from the LEB with JSONP " from here: http://api.biblia.com/docs/Samples
I want to fetch the JSONP data and use in my php script. I googled online, but did not find how to do it.
So I tried this way:
<?php
$jsonurl = "http://api.biblia.com/v1/bible/content/LEB.txt.js?passage=John3.16&key=fd37d8f28e95d3be8cb4fbc37e15e18e";
$json = file_get_contents($jsonurl);
$json_output = json_decode($json);
var_dump($json_output);
You can see actually i removed &callback=myCallbackFunction and use json instead of jsonp. I can get the result, but somehow I do not think this is the proper way to do it. So how could I do this in php properly?