Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $str="test content %list:UnsubscriptionLink% some other %list:subscriptionLink% test";
- $str="test content # some other # test";
- $str="test content %list:UnsubscriptionLink% some other test";
- echo preg_replace('~(%.*%)~','#',$str); //Its working
- $str="test content %list:UnsubscriptionLink% some other %list:UnsubscriptionLink% test";
- echo preg_replace('~(%.*%)~','#',$str); //Its Not working
- <?php
- $str="test content %list:UnsubscriptionLink% some other %list:UnsubscriptionLink% test";
- echo preg_replace('~(%[^%]+%)~','#',$str);
- test content # some other # test
- ~%[^%]+%~
- <?php
- $str="test content %list:UnsubscriptionLink% some other %list:UnsubscriptionLink% test";
- echo preg_replace('~%[^%]+%~','#',$str);
- ?>
- test content # some other # test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement