0

I'm trying to create simple reader using PHP. I have library to get list of chapters including path. For example I have

chapters => array (43)
    0 => ePub\Definition\Chapter #d1af
        title => "Prolog" (6)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_002.htm" (86)
        position => 1
        children => array ()
    1 => ePub\Definition\Chapter #0b7d
        title => "Bran" (4)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_003.htm" (86)
        position => 2
        children => array ()
    2 => ePub\Definition\Chapter #6b22
        title => "Catelyn" (7)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_004.htm" (86)
        position => 3
        children => array ()
    3 => ePub\Definition\Chapter #d104
        title => "Daenerys" (8)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_005.htm" (86)
        position => 4
        children => array ()
    4 => ePub\Definition\Chapter #92cb
        title => "Eddard" (6)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_006.htm" (86)
        position => 5
        children => array ()
    5 => ePub\Definition\Chapter #81ac
        title => "Jon" (3)
        src => "OEBPS/Text/Hra%20o%20truny%201%20-%20George%20Raymond%20Richard%20Martin_split_007.htm" (86)
        position => 6
        children => array ()

I think that epub acts like ZIP archive so I tried to find solution to read single file from ZIP archive. I found this, but it doesn't work for me. Any ideas how to read the file from epub wihout extracting it anywhere?

Community
  • 1
  • 1
Northys
  • 1,305
  • 3
  • 16
  • 32
  • What problem are you having when using the method you linked to ? – Golu Jul 09 '14 at 01:30
  • `Warning: file_get_contents(zip://book.epub#test.txt): failed to open stream: operation failed.` For testing I added test.txt into book.epub to be sure. First i thought the problem is in the filename with spaces, but it doesn't work on text.txt as well. I'm working on Windows, but i tried it on LAMP hosting as well. – Northys Jul 09 '14 at 06:03

0 Answers0