php
  • regex
  • string
  • preg-replace
  • logic
  • 2012-07-09 93 views 0 likes 
    0

    檢索,即時通訊遺漏,我需要獲取img標籤信息,以及(<img src="images/construction.jpg" border="0" alt="" />)我需要做的是利用該代碼即時通訊有什麼功能和代碼修正案是我foreach環路的數據從迭代D b。字符串中使用的preg_replace

    我的工作守則---

    <?php 
    
    $content = '<p><img src="images/construction.jpg" border="0" alt="" />This is only a testing phase data</p>'; 
    
    $content = preg_replace("/<img[^>]+\>/i", "", $content); 
    
    echo $content; //OUTPUT -- This is only a testing phase data 
    
    ?> 
    

    回答

    2

    您需要使用preg_match中檢索數據,而不是preg_replace

    相關問題