Well, that's one way. But if you had enough classes and ids to choose between (when constructing the HTML) then you wouldn't need to use PHP variables in your css?! Just apply different class-names as you build the page.
If you wanted to apply one of two different sets of CSS rules then you could use PHP to attach one .css file or the other to the page.
I don't see the need to embed PHP in a css file
. To me, it adds an unnecessary level of complexity.