Count the number of selectors inside of a CSS string.
Parameters
string $css_string: CSS string.
Return value
int The number of CSS selectors.
3 calls to advagg_count_css_selectors()
- AdvAggCascadingStylesheetsTestCase::testRenderFile in tests/
advagg.test - Tests rendering the stylesheets.
- advagg_get_info_on_files in ./
advagg.inc - Given a filename calculate various hashes and gather meta data.
- advagg_split_css_file in ./
advagg.inc - Given a file info array it will split the file up.
File
-
./
advagg.inc, line 1190
Code
function advagg_count_css_selectors($css_string) {
return substr_count($css_string, ',') + substr_count($css_string, '{') - substr_count($css_string, '@media');
}