How to pass parameters dynamically in PHP?

Posted by user198729 on Stack Overflow See other posts from Stack Overflow or by user198729
Published on 2010-03-11T05:37:23Z Indexed on 2010/03/11 5:38 UTC
Read the original article Hit count: 184

Filed under:
|

I need to pass the $route to its inner function,but failed:

function compilePath( $route )
{
    preg_replace( '$:([a-z]+)$i', 'pathOption' , $route['path'] );
    function pathOption($matches)
    {
        global $route;//fail to get the $route
    }
}

I'm using php5.3,is there some feature that can help?

© Stack Overflow or respective owner

Related posts about php

Related posts about parameters