Documentation

InlineStyleParser
in package

Table of Contents

Properties

$normalizeProperties  : NormalizeProperties

Methods

__construct()  : mixed
parse()  : array<string|int, mixed>
Parse inline CSS style attribute.
processUrlsInCss()  : string
Process URLs in CSS strings by encoding special characters.

Properties

Methods

parse()

Parse inline CSS style attribute.

public parse(string $html) : array<string|int, mixed>

Parses a CSS string from an HTML style attribute and returns an array of CSS properties.

Parameters
$html : string

CSS string from style attribute

Return values
array<string|int, mixed>

Parsed CSS properties

processUrlsInCss()

Process URLs in CSS strings by encoding special characters.

public processUrlsInCss(string $css) : string

Characters "(", ")", and ";" in url() can cause problems parsing CSS. This method URLencodes ( and ), and temporarily encodes ";" to prevent confusion with CSS segment delimiters.

Parameters
$css : string

CSS string containing url() references

Return values
string

CSS string with processed URLs


        
On this page

Search results