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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -