Skip to content

Instantly share code, notes, and snippets.

@fret2buzz
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save fret2buzz/61ff4ac3938bac2436d3 to your computer and use it in GitHub Desktop.

Select an option

Save fret2buzz/61ff4ac3938bac2436d3 to your computer and use it in GitHub Desktop.
<?php
$workingPath = 'h:/css';
$cssFiles = $workingPath . '/clear';
$cssFixedFiles = $workingPath . '/fixed';
$files = glob($cssFiles . '/*');
foreach($files as $k => $v) {
$basename = basename($v);
var_dump($basename);
$cssCode = file_get_contents($cssFiles . '/' . $basename);
$cssCode = preg_replace_callback(
"#([: \/])([\-\d\.]+)px#msi",
function ($matches) {
return $matches[1] . $matches[2]*2 . 'px';
},
$cssCode);
file_put_contents($cssFixedFiles . '/' . $basename, $cssCode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment