Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Created February 26, 2012 13:33
Show Gist options
  • Save KitaitiMakoto/1916749 to your computer and use it in GitHub Desktop.
Save KitaitiMakoto/1916749 to your computer and use it in GitHub Desktop.
PHP-CSS-ParserのDeclarationBlockは__toString()が使える ref: http://qiita.com/items/2837
<?php
require(dirname(__FILE__) . '/../CSSParser.php');
$cssFile = 'epub/OEBPS/stylesheet.css';
$parser = new CSSParser(file_get_contents($cssFile));
$css = $parser->parse();
foreach ($css->getAllDeclarationBlocks() as $db) {
echo $db, PHP_EOL;
echo '---------------------------------------------', PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment