Guest User

Untitled

a guest
May 20th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <li><p><!-- watermark --></p></li>
  2.  
  3. $methodfinal = str_replace('<li><p><!--', '<!--', $method);
  4. $methodfinal2 = str_replace('--></p></li>', '-->', $methodfinal);
  5. echo $methodfinal2;
  6.  
  7. $final = preg_replace('/<li><p>[s]*?<!--(.*?)--></p></li>/m', "<!--$1-->", $z);
  8.  
  9. <li><p>
  10.  
  11. [s]*?
  12.  
  13. <
  14.  
  15. !--(.*?)--
  16.  
  17. ></p></li>
  18.  
  19. /m'
  20.  
  21. $final = preg_replace("/<li><p>(<!--.*-->)</p></li>/", "$1", $original);
  22.  
  23. $final = preg_replace("/<li><p>(<!--.*?-->)</p></li>/", "$1", $original);
  24. # use .*? every time over .* unless you specificly want what it does
  25. # .*? matches as less as it can
  26. # .* matches as much as it can
  27.  
  28. $final = preg_replace("/<li><p>(<!--[^->]+-->)</p></li>/", "$1", $original);
  29. # [^->]+ will look for any character that is not - or >
  30. # so will perform faster
Add Comment
Please, Sign In to add comment