PHP Classes
elePHPant
Icontem

File: example/index.php

Recommend this page to a friend!
  Classes of Lars Moelleken  >  PHP CSS to Inline Styles  >  example/index.php  >  Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP CSS to Inline Styles
Convert CSS styles into HTML attribute values
Author: By
Last change:
Date: 2 years ago
Size: 445 bytes
 

 

Contents

Class file image Download
<?php

require_once 'config.php';
require_once
__DIR__ . '/../vendor/autoload.php';

use
voku\CssToInlineStyles\CssToInlineStyles;

// create instance
$cssToInlineStyles = new CssToInlineStyles();

$html = file_get_contents(__DIR__ . '/examples/sumo/index.htm');
$css = file_get_contents(__DIR__ . '/examples/sumo/style.css');

$cssToInlineStyles->setHTML($html);
$cssToInlineStyles->setCSS($css);

// output
echo $cssToInlineStyles->convert();