PHP Multiline RegEx

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sprite
    New Member
    • Aug 2007
    • 1

    #1

    PHP Multiline RegEx

    Hello,

    I want replace all text outside HTML tags using PHP & RegEx, so i used >(.*?)< but this does not working if there are CR/LF in text. How to expand this to support CR/LF inside without php.ini modification
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Use /s in your requlare expression as below
    [PHP]preg_replace("/...>(.*?)<.../s", $replace, $source);[/PHP]
    If you still have problem, post your code.

    Comment

    Working...