php
  • regex
  • string
  • preg-replace
  • logic
  • 2012-07-09 36 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

    相关问题