yii\helpers\BaseHtml::cssStyleToArray PHP Метод

cssStyleToArray() публичный статический Метод

The array keys are the CSS property names, and the array values are the corresponding CSS property values. For example, php print_r(Html::cssStyleToArray('width: 100px; height: 200px;')); will display: ['width' => '100px', 'height' => '200px']
public static cssStyleToArray ( string $style ) : array
$style string the CSS style string
Результат array the array representation of the CSS style
    public static function cssStyleToArray($style)
    {
        $result = [];
        foreach (explode(';', $style) as $property) {
            $property = explode(':', $property);
            if (count($property) > 1) {
                $result[trim($property[0])] = trim($property[1]);
            }
        }
        return $result;
    }