久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網
      最全最豐富的資訊網站

      php 正則怎么去掉內容中的圖片

      php正則去掉內容中圖片的方法:首先創(chuàng)建一個PHP示例文件;然后通過“preg_replace('/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]…>;”方法去掉圖片即可。

      php 正則怎么去掉內容中的圖片

      本文操作環(huán)境:Windows7系統(tǒng)、PHP7.1版,DELL G3電腦

      php 正則怎么去掉內容中的圖片?

      php正則刪除img標簽的方法。

      具體如下:

      一、問題

      正則抓取過程中需要刪除正文中的img標簽,如:

      <div>歡迎訪問php中文網<img src="https://www.php.cn/images/logo.gif" /></div>

      要求刪除后變成:

      <div>歡迎訪問php中文網</div>

      二、解決方法:

      $str='<div>歡迎訪問php中文網<img src="https://www.php.cn/images/logo.gif" /></div>'; $str= preg_replace('/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]*?/?s*>/i', '', $str); echo $str;

      運行結果:

      <div>歡迎訪問php中文網</div>

      推薦學習:《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號