You are here

private function Emogrifier::cssStyleDefinitionToArray in HTML Mail 6

Same name and namespace in other branches
  1. 5 emogrifier/emogrifier.php \Emogrifier::cssStyleDefinitionToArray()
1 call to Emogrifier::cssStyleDefinitionToArray()
Emogrifier::emogrify in emogrifier/emogrifier.php

File

emogrifier/emogrifier.php, line 156
CSS to Inline Converter Class

Class

Emogrifier

Code

private function cssStyleDefinitionToArray($style) {
  $definitions = explode(';', $style);
  $retArr = array();
  foreach ($definitions as $def) {
    list($key, $value) = explode(':', $def);
    if (empty($key) || empty($value)) {
      continue;
    }
    $retArr[trim($key)] = trim($value);
  }
  return $retArr;
}