将PHP代码转换为CSS文件?

I make a slider for my website, I make 3 pictures in CSS file

code :

.banner1{
    background:url(../images/bnr1.png) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}
.banner2{
    background:url(../images/bnr2.jpg) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}
.banner3{
    background:url(../images/bnr3.jpg) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}

but I want to take the last 3 posts from the database and make them in slider

So, is there any method to make the php code into CSS file ?

</div>

You wouldn't want to write the file references to a new .css file, better to echo them directly into a style tag like so:

</php
//PHP CODE
?>

<head>
<style>
    .banner1{
    background:url(<?php echo //FILE REFERENCE 1 ?>) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}
.banner2{
    background:url(<?php echo //FILE REFERENCE 2 ?>) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}
.banner3{
    background:url(<?php echo //FILE REFERENCE 3 ?>) no-repeat 0px 0px;
    background-size:cover;
    min-height:650px;
}
</head>
</style>

<?php 

//MORE CODE