protected function getZipContent($file, $as_xml = true) { // Locates an entry using its name $index = $this->zip->locateName(urldecode($file)); if (false === $index) { return ''; } // returns the contents using its index $content = $this->zip->getFromIndex($index); // if it's not xml, return if (!$as_xml) { return $content; } // if it is xml, then instantiate and return a simplexml object return new \SimpleXMLElement($content); }