Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why does JSON decode this as NULL object?

    I tried this using php json_decode function() as well as this package. Both of them produce NULL. Anyone have any idea as to why?

    JSON is here -> http://facebook.dreamhosters.com/tmpjson

    PHP code:

    Code:
    <?php
    
    include_once("JSON.php");
    
    $handle = @fopen("http://facebook.dreamhosters.com/tmpjson", "r");
    
    if ($handle) {
        $json = new Services_JSON();
    
        while (!feof($handle)) {
            $buffer = trim(fgets($handle, 500000));
    	    //$object = json_decode($buffer);
    	    $object = $json->decode($buffer);
    	    var_dump($object);
        }
        fclose($handle);
    }
    ?>
    Last edited by kimtd; 01-23-2008 at 01:18 AM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Well it is WAY to long for me to go through that entire thing. It is 53K+ long....rather crazy...

    If you run it in firefox where you take it and eval it it says: "invalid label"

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •