There are several ways.
You could tell the webserver to treat the file as PHP (renaming to have a .php extension would be the simplest) and then add:
<?php
header("Content-type: text/css; charset=utf-8");
ob_start("ob_gzhandler")
?>
to the top.
You could write a PHP script that does the same thing, but reads in the CSS file instead of having it inline.
Both this options lead to caching issues - you would have to take care of the cache control HTTP headers too if you want to be sane about it.
The best option would be to forget about PHP and just configure your webserver to compress those files (using mod_deflate, mod_gzip or similar)