public function load($fname)
    {
        $this->fname = $fname;
        if (file_exists($this->fname)) {
            $contents = file_get_contents($this->fname);
            $this->data = json_decode($contents);
        } else {
            $this->data = json_decode("[]");
        }

        $data =& $this->data;
        return $data;
    }
public function load($fname)
    {
        $this->fname = $fname;
        if (file_exists($this->fname)) {
            $contents = file_get_contents($this->fname);
            $this->data = json_decode($contents);
        } else {
            $this->data = json_decode("[]");
        }

        $data =& $this->data;
        return $data;
    }
public function load ( $ fname ) { $ this -> fname = $ fname ; if ( file_exists ( $ this -> fname ) ) { $ contents = file_get_contents ( $ this -> fname ) ; $ this -> data = json_decode ( $ contents ) ; } else { $ this -> data = json_decode ( "[]" ) ; } $ data = & $ this -> data ; return $ data ; }
Loads in the requested file name, grabs the content and sets the json object
Loads in the requested file name grabs the content and sets the json object