久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何正則替換img標記屬性

      php正則替換img標記屬性的方法是:可以通過preg_match()函數(shù)來實現(xiàn)。該函數(shù)用來執(zhí)行一個正則表達式匹配,并返回匹配次數(shù)。preg_match()函數(shù)在第一次匹配后就會停止搜索。

      php如何正則替換img標記屬性

      我們可以通過preg_match()函數(shù)來實現(xiàn)。

      (推薦教程:php教程)

      函數(shù)介紹:

      preg_match 函數(shù)用于執(zhí)行一個正則表達式匹配。

      函數(shù)語法:

      int preg_match( string $pattern ,string $subject [,array &$matches [,int $flags = 0 [,int $offset = 0]]] )

      返回值:

      返回 pattern 的匹配次數(shù)。 它的值將是 0 次(不匹配)或 1 次,因為 preg_match() 在第一次匹配后 將會停止搜索。preg_match_all() 不同于此,它會一直搜索subject 直到到達結(jié)尾。 如果發(fā)生錯誤preg_match()返回 FALSE。

      代碼實現(xiàn):

      <?php /*PHP正則提取圖片img標記中的任意屬性*/ $str = '<center><img src="/uploads/images/20100516000.jpg" height="120" width="120"><br />PHP正則提取或更改圖片img標記中的任意屬性</center>';

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