Replacing tag with tag using PHP

前端 未结 4 1286
无人及你
无人及你 2020-12-17 03:09

OK, I have a section of code with things like:
Text

I need to reformat thes

4条回答
  •  悲哀的现实
    2020-12-17 03:40

    To replace a tag by another and matching / replacing attributes names at the same time :

    $string = 'Alternative';
    $string = preg_replace('/(.+?)/is','',$string);
    //$string is now ''
    

提交回复
热议问题