public function saveJSON($path_or_resource, $mode = 'wb')
	{
		$json = $this->_root->asJSON();

		if (is_resource($path_or_resource))
		{
			return fwrite($path_or_resource, $json);
		}

		$fp = fopen($path_or_resource, $mode);
		$bytes = fwrite($fp, $json);
		fclose($fp);

		return $bytes;
	}
public function saveJSON($path_or_resource, $mode = 'wb')
	{
		$json = $this->_root->asJSON();

		if (is_resource($path_or_resource))
		{
			return fwrite($path_or_resource, $json);
		}

		$fp = fopen($path_or_resource, $mode);
		$bytes = fwrite($fp, $json);
		fclose($fp);

		return $bytes;
	}
public function saveJSON ( $ path_or_resource , $ mode = 'wb' ) { $ json = $ this -> _root -> asJSON ( ) ; if ( is_resource ( $ path_or_resource ) ) { return fwrite ( $ path_or_resource , $ json ) ; } $ fp = fopen ( $ path_or_resource , $ mode ) ; $ bytes = fwrite ( $ fp , $ json ) ; fclose ( $ fp ) ; return $ bytes ; }
Save the XML node structure as a JSON document

@param mixed $path_or_resource
@param string $mode
@return integer
Save the XML node structure as a JSON document