如何在更改css背景图像时使用$ x使PHP for循环工作?

Here is my new code. I can't get the for loop to work.. It's only working for $x = 1 but does not run through up to 5..

<?php for ($x=1; $x<=5; $x++) { ?>
<div class="active item">
<div class="fill" style="background-image:url('<?php echo onepage_get_option("onepage_sliderimage" . $x); ?>');">
<div class="container">
<h3 class="carousel_headline"><?php echo onepage_get_option('onepage_sliderimage' . $x . '_heading_middle'); ?></h3>
</div>
</div>
</div>
<?php } ?>

</div>

Variables in single quotes do not work. Use like this

This works

echo "$x"

This does not

echo '$x'

Use it like this

"onepage_sliderimage" . $x

'onepage_sliderimage' . $x . '_heading_middle'