您好,我想用數據庫中的圖像顯示段落。 但我想刪除內聯樣式寬度圖像。以內聯樣式刪除樣式寬度圖像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