PHP code example of thelia / smarty-filter-module

1. Go to this page and download the library: Download thelia/smarty-filter-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thelia / smarty-filter-module example snippets


class EmailFilter
{

    public function filter($tpl_output, $smarty)
    {
        $tpl_output =
            preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!',
                '$1%40$2', $tpl_output);

        return $tpl_output;
    }
}