hankknight
asked on
Remove everything between <[% and %]>
I want to remove all instances of everything between <[% and %]>
ASKER
Thanks, hielo, but your idea does not work.
<?php
$str= 'Hello <[%edit%]> World <[%/edit%]>';
echo preg_replace( '#<\[%[^%]%\]>#','', $str);
// Should Output: Hello World
?>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
I have posted a related question here:
https://www.experts-exchange.com/questions/23838405/Remove-everything-between-and.html
I have posted a related question here:
https://www.experts-exchange.com/questions/23838405/Remove-everything-between-and.html
Thanks for the question and the points.
glad to help
echo preg_replace( '#<\[%[^%]%\]>#','',$str );