php - Getting page names with preg_replace_callback -
i have file list of links. links in format of /pagename.htm. i'm trying use preg_replace_callback of page names callback function never gets called. i'm sure has regex don't see how fix it. please point out problem.
    return  preg_replace_callback("/^(\/(.*?)\.htm)$/", "handlelinks", $filenames);       function handlelinks($matches) {           echo 'match '.$matches[1].'<br>';        return $matches;     }      
i able work following:
    preg_replace_callback("/(\/(.*?)\.htm)/", "handlelinks", $filenames);       
Comments
Post a Comment