epub files are just HTML / XML and CSS, so you can easily open the epub container (this is a zip file) and then parse the XML internally using a language such as PHP.
This should not be too hard to do.
The format is as follows:
--ZIP Container-- mimetype META-INF/ container.xml OPS/ book.opf chapter1.xhtml ch1-pic.png css/ style.css myfont.otf
Here is an example of the content you can find in chapter 1:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <title>Pride and Prejudice</title> <link rel="stylesheet" href="css/main.css" type="text/css" /> </head> <body> ... </body> </html>
source share