public static function parametrize($str, $params)
    {
        $keys = array_keys($params);
        $vals = array_values($params);

        array_walk($keys, function(&$key) {
            $key = '%' . $key . '%';
        });

        return str_replace($keys, $vals, $str);
    }
public static function parametrize($str, $params)
    {
        $keys = array_keys($params);
        $vals = array_values($params);

        array_walk($keys, function(&$key) {
            $key = '%' . $key . '%';
        });

        return str_replace($keys, $vals, $str);
    }
public static function parametrize ( $ str , $ params ) { $ keys = array_keys ( $ params ) ; $ vals = array_values ( $ params ) ; array_walk ( $ keys , function ( & $ key ) { $ key = '%' . $ key . '%' ; } ) ; return str_replace ( $ keys , $ vals , $ str ) ; }
Parametrize string using array of params.

@param string $str
@param string[] $params
@return string
Parametrize string using array of params .