This is Jason's Responsive Background Image Twig Macro translated into PHP for use with ACF image fields:
<?php function responsive_ACF_background_image($image, $display_style, $css_path) {
$retina_style = $display_style . "2x";
echo "<style>
$css_path {
background-image: url(\"" . $image[sizes][$display_style] . "\");
}
@media