I am trying to change image attribute from data-original=""
to src=""
Checkout the codes below
<img class="lazyjs bbcodeImage" src="//somesite.com/images/sample.gif" data-original="//somesite.com/images/sample.gif" alt="image">
in the above code we have 2 attributes 1st src=""
and 2nd is data-original=""
so i want to replace data-original=""
to src=""
, I have tried using str_replace
but it doesn't work,
$thumb = str_replace(array('data-original=','src='),array('src=','data='),$thumb);
how can i do this using PHP?