<?php
function get_img_thumb_url($content=""){
$pregRule = "/<[img|IMG].*?src=[\'|\"](https)(.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\'|\"].*?[\/]?>/";
$content = preg_replace($pregRule, '<img src="http$2">', $content);
return $content;
}
$content = '<a href="#"><img class="center" src="https://xxx.com/styles/images/default.jpg"></a><p><img class="center" src="https://img.xxx.com/images/219_Ig5eZI.jpg" style="max-width: 100%;"></p>';
$newct = get_img_thumb_url($content);
print_r($newct);
?>