PHP - remove

后端 未结 7 2475
梦如初夏
梦如初夏 2020-11-27 15:15

Hey, I need to delete all images from a string and I just can\'t find the right way to do it.

Here is what I tryed, but it doesn\'t work:

preg_replac         


        
7条回答
  •  暖寄归人
    2020-11-27 15:41

    Try dropping the \ in front of the >.

    Edit: I just tested your regex and it works fine. This is what I used:

     in it.";
        $content = preg_replace("/]+\>/i", "(image) ", $content); 
        echo $content;
    ?>
    

    The result is:

    this is something with an (image)  in it.
    

提交回复
热议问题