public function replaceVariables($pattern, $string, $replace)
    {
        $count = preg_match($pattern, $string, $result);

        for ($i = 0; $i < $count; $i += 2) {
            $string = str_replace($result[$i], $this->getVariable($result[$i + 1]), $string);
        }

        return $string;
    }
public function replaceVariables($pattern, $string, $replace)
    {
        $count = preg_match($pattern, $string, $result);

        for ($i = 0; $i < $count; $i += 2) {
            $string = str_replace($result[$i], $this->getVariable($result[$i + 1]), $string);
        }

        return $string;
    }
public function replaceVariables ( $ pattern , $ string , $ replace ) { $ count = preg_match ( $ pattern , $ string , $ result ) ; for ( $ i = 0 ; $ i < $ count ; $ i += 2 ) { $ string = str_replace ( $ result [ $ i ] , $ this -> getVariable ( $ result [ $ i + 1 ] ) , $ string ) ; } return $ string ; }
Replaces a string with another one in passed string.

@param string $pattern The pattern to be used for detection
@param string $string  String to work with
@param string $replace Replacement string

@author Benjamin Carl <opensource@clickalicious.de>

@return string The resulting string
Replaces a string with another one in passed string .