QuickBooks/XML/Parser.php
protected function _read($mixed)
	{
		if (empty($mixed))
		{
			return '';
		}
		else if (is_resource($mixed) and
			get_resource_type($mixed) == 'stream')
		{
			$buffer = '';
			$tmp = '';
			while ($tmp = fread($mixed, 8192))
			{
				$buffer .= $tmp;
			}

			return $buffer;
		}
		else if (substr(trim($mixed), 0, 6) == '{"warn')
		{
			// Intuit has a bug where some of their services return JSON erors 
			// instead of XML, so we catch these here... 
			
			return '';
		}
		else if (substr(trim($mixed), 0, 1) != '<')
		{
			return file_get_contents($mixed);
		}

		return $mixed;
	}
protected function _read($mixed)
	{
		if (empty($mixed))
		{
			return '';
		}
		else if (is_resource($mixed) and
			get_resource_type($mixed) == 'stream')
		{
			$buffer = '';
			$tmp = '';
			while ($tmp = fread($mixed, 8192))
			{
				$buffer .= $tmp;
			}

			return $buffer;
		}
		else if (substr(trim($mixed), 0, 6) == '{"warn')
		{
			// Intuit has a bug where some of their services return JSON erors 
			// instead of XML, so we catch these here... 
			
			return '';
		}
		else if (substr(trim($mixed), 0, 1) != '<')
		{
			return file_get_contents($mixed);
		}

		return $mixed;
	}
Read an open file descriptor, XML file, or string

@param mixed $mixed
@return string