FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » json_decode problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
json_decode problem [message #178832] Fri, 10 August 2012 21:30 Go to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
I am stuck with json_decode. I have a json file
http://houghi.org/Fun/imdb.json
I want it to look like http://www.imdb.com/title/tt0382932/quotes
Well, not completely. Just pure text.

e.g. the second one should be something like
quotenumber = qt0465193
Remy/nm0652663 Stage=observing what Emile is eating Quote=What are you eating?
Emile/nm0812307 Stage=pause Quote=I don't really know. I think it was some sort of wrapper once.
Remy/nm0652663 Quote=What? No! You're in Paris now, baby! My town! No brother of mine eats rejecta-menta in my town!

The code I have is extremely basic. I have been looking at many
websites, but am unable to figure it out what I must put in it to make
it work:

<?php
$json = file_get_contents("imdb.json");
$result = json_decode($json);
foreach($result->data->quotes as $p)
{
$qconst = $p->qconst;
echo "quotenumber = $qconst<br>";
//Some foreach here?
//No idea what to put here
}
?>

I do get the above part right, but I am lost on how to do the rest. I assume I
must do some other foreach. No idea where to start, even after many days
and websites.

houghi
--
You can have my keyboard ...
if you can pry it from my dead, cold, stiff fingers
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PEAR Auth package woes
Next Topic: redirect on zend
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 19:24:22 GMT 2024

Total time taken to generate the page: 0.05240 seconds