0
I’m trying to make a API.
This is my code:
require('conexao/conexao.php');
$jsonObj= array();
$query="SELECT * FROM filmes";
$sql = mysql_query($query)or die(mysql_error());
while($data = mysql_fetch_assoc($sql))
{
$row[] = $data;
header("Content-type:application/json");
array_push($jsonObj,$row);
}
I’m trying to get the data from API with the code below, but does not return me anything:
$url = "http://fimhd.com.br/api.php";
$captura = file_get_contents($url);
$json = json_decode($captura);
var_dump($json);
Thanks Dude, it worked here :D
– Carlos da Silva