No, that won't work. Geoserver is expecting an SLD, so it will fail parsing any PHP code you insert there.
What you can do is generate the SLD outside of Geoserver and pass it over when requesting the map from Geoserver. In OpenLayers it works like this:
var sld = '<StyledLayerDescriptor version ="1.0.0" ...> more xml here </StyledLayerDescriptor>';
wms = new OpenLayers.Layer.WMS.Post(
More info: Dynamic Styling and Filtering of a Geoserver WMS Using OpenLayers.Layer.WMS.Post
Update: You can find a lot of SLD examples in Geoserver's SLD Cookbook.