protected function copyParam($from, $target, $param, $default)
    {
        // param has been changed
        if (strpos($from, sprintf($param, $default)) === false) {
            list($left, $right) = explode('%s', $param);
            $start = strpos($from, $left) + strlen($left);
            $end = strpos($from, $right, $start);
            $value = substr($from, $start, $end - $start);
            $target = str_replace(sprintf($param, $default), sprintf($param, $value), $target);
        }

        return $target;
    }
protected function copyParam($from, $target, $param, $default)
    {
        // param has been changed
        if (strpos($from, sprintf($param, $default)) === false) {
            list($left, $right) = explode('%s', $param);
            $start = strpos($from, $left) + strlen($left);
            $end = strpos($from, $right, $start);
            $value = substr($from, $start, $end - $start);
            $target = str_replace(sprintf($param, $default), sprintf($param, $value), $target);
        }

        return $target;
    }
protected function copyParam ( $ from , $ target , $ param , $ default ) { // param has been changed if ( strpos ( $ from , sprintf ( $ param , $ default ) ) === false ) { list ( $ left , $ right ) = explode ( '%s' , $ param ) ; $ start = strpos ( $ from , $ left ) + strlen ( $ left ) ; $ end = strpos ( $ from , $ right , $ start ) ; $ value = substr ( $ from , $ start , $ end - $ start ) ; $ target = str_replace ( sprintf ( $ param , $ default ) , sprintf ( $ param , $ value ) , $ target ) ; } return $ target ; }
Copy param value if need.

@param string $from
@param string $target
@param string $param
@param string $default

@return string
Copy param value if need .