您好,我想用数据库中的图像显示段落。 但我想删除内联样式宽度图像。以内联样式删除样式宽度图像php
例如:
<?php $prg = "hello this is paragragph and this is image 1
<img src='https://www.google.co.id/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' style='width:150px;heigh:150px'>
this is text and this is image 2
<img src='http://www.bing.com/az/hprichbg/rb/HumpbackWhaleReunion_ROW11050338497_1366x768.jpg' style='width:150px;heigh:150px' ></p>";
echo $prg; ?>
我想在内嵌样式删除宽度图像。
这段代码的结果,我想这样的
<?php $prg = "hello this is paragragph and this is image 1
<img src='https://www.google.co.id/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' style='heigh:150px'>
this is text and this is image 2
<img src='http://www.bing.com/az/hprichbg/rb/HumpbackWhaleReunion_ROW11050338497_1366x768.jpg' style='heigh:150px' ></p>";
echo $prg; ?>
使用style ='heigh:150px; width:0' – devpro
这个数据来自数据库,我无法改变。 –
如果你得到的数据库比尝试: – devpro