- preg_replace: documentation ( source)
<?php
$input = ' <img height="20" src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" data-thumb="//i.ytimg.com/i/YfdidRxbB8Qhf0Nx7ioOYw/1.jpg" width="20" aria-hidden="true" >';
$input = preg_replace('#<img[^>]*data-thumb=#s', '<img alt="Thumbnail" src=', $input);
echo $input;