<?php
function dissasemble_css($css) {
// Formatted statements.
$formatted_statements =
array();
// Remove comments.
// Split out each statement
// If we have any statements, parse them.
if (count($statements) >
0) {
// Iterate through all of the statements.
foreach ($statements as $statement) {
// Get the key and the code for the key.
// Get all keys individually.
// If we have more than one key, handle them.
// Iterate through all the keys and add them to the array.
foreach ($keys as $key) {
// Replace un-needed characters and do a little cleanup.
// Make sure this is a real key.
// Add the key to the array.
$formatted_statement['keys'][] = $key;
}
}
}
// It's easier to handle and looks nicer if it's lower case.
// Make sure the explosion is big!
$code_fragements =
explode(";",
$code);
// Make sure there actually are any remains from the explosion.
if (count($code_fragements) >
0) {
// Iterate through the remains and parse them.
foreach ($codes as $code) {
// Explode the remaining fragements some more, but clean them up first.
// If the key (the first part) actually exists, then add it.
if(strlen($code_remains[0]) >
0) {
// Add it to the array
}
}
}
}
}
// Return the statements.
return $formatted_statements;
}