久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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正則匹配圖片并給圖片加鏈接詳解

      正則:

      復制代碼 代碼如下:
      $newstext=preg_replace(preg_replace(‘/(<img[^>]+srcs*=s*”?([^>”s]+)”?[^>]*>)/im’, ‘<a href=”$2″>$1</a>’, $newstext);

      解說:
      1.preg_replace和str_replace的區(qū)別:

      str_replace只是純字符替換,而preg_replace才是正則替換

      2.$0,$1,$2等的說明:

      $0指的是被整個模式所匹配的文本;

      $1指的是首個 ( ) 引用的串;

      $2指的是第二個()引用的串; 以此類推。

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