Friday, June 10, 2011

Replace in string : preg_replace

        $pattern = '/(\d+),(\w+)/i';
        $replacement = '<strong>${1}</strong>,$2';
        return  Mage::log( $this->getQuote()->getStore()->formatPrice($price , true) );
        return preg_replace($pattern, $replacement, Mage::log( $this->getQuote()->getStore()->formatPrice($price , false) ) );



No comments:

Post a Comment

Powered by Blogger.