I have html string like this
<input alt="" src="/global/admin/plugins/fileman/Uploads/Images/Mail_1.jpg" style="width: 600px; height: 600px;" type="image" />
and want to make two changes it is using preg_replace
1- change tag to input == > img
2 -add the website link to the src path
I am trying to use this code and i's working good but the result has double quotations like below and this broke the link,i want to add the website URL without additional quotations
<img width="600" src="http://mywebsite.com/"/global/admin/plugins/fileman/Uploads/Images/Mail_1.jpg">
this is the php code
$pattern = "/(<input\s+).*?src=((\".*?\")|(\'.*?\')|([^\s]*)).*>/is";
$base = 'http://mywebsite.com/';
$replacement = "<img width=600 src=$base$2>";
echo preg_replace($pattern, $replacement, $html);