Hi, need a little help here

First of all, sorry for my bad english.

I have this:

[php]$link = file_get_contents(“http://www.imdbapi.com/?i=tt1285016”);
$json = json_decode($json,true);
echo $json[“Title”];[/php]

and I want to replace tt1285016 with $info[“id”]; (this is something from mysql, first time when i use :((.
If I put echo $info[“id”]; it return exactly what i need: tt1421545.

How can I do that? thank u very much and sorry again for bad enlighs, not native language. :slight_smile:

it’s:

$json = json_decode($link,true);

sorry for mistake.

please do this and reply.. /* Use the below code instead of current code. Here $info["id"] is the value return from database. as you define here */ [php]

/* Use the below code instead of current code. Here $info[“id”] is the value return from database. as you define here */

$getcontenturl = “http://www.imdbapi.com/?i=".$info["id”];
$link = file_get_contents($getcontenturl);
$json = json_decode($json,true);
echo $json[“Title”];

[/php]

Reply your feedback.
SR~

hi and thank u very much for reply.

I do what u said and i get this error:

Notice: Undefined index: Title in C:\xampp\htdocs\muvi.php on line 9

So i tried echo $json; (without “Title”) and i get Array.

and idea? thanks again.

solved, thank u so much anyway. :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service