Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged regexp
- All /
 - JavaScript /
 - HTML /
 - PHP /
 - CSS /
 - Ruby /
 - Objective C
 
 « Prev 1 Next »
Match nested html elements using regular expressions.
Replace the first part of the magic "[a-z]+" to search for a specific tag, e.g. "div".
Loop the magic on matched parts to create a recursive match.
        
        
        
            1 
        
        
            1148 
        
                    posted 11 years ago by pvq
            For several reasons, including portability, reducing download size, and general code neatness, I like to make all links within a website root relative.
        
        
        
            0 
        
        
            1097 
        
                    posted 15 years ago by weboholic
            Very simple to use.
**Calling:**
    $files = dirContents(DIR_PATH, [FILTER, [TYPE]]);
**Examples:**
    $files = dirContens("my-dir");
_$files_ is array containing all, both files either directories
    $files = dirContens("my-dir",...
        
        
        
            0 
        
        
            1036 
        
                    posted 15 years ago by Lostindream
            You can get hostname from script environment - getenv("HTTP_HOST")
(?!'.$host.') matches URLs always except local links
        
        
        
            0 
        
        
            1189 
        
                    posted 16 years ago by kossmoss
             « Prev 1 Next »