public function setDynamicContent(array $params, string $content)
    {
        $processed_content = preg_replace_callback(
            '~\{(.*?)\}~si',
            function ($match) use ($params) {
                return str_replace($match[0], isset($params[$match[1]]) ? $params[$match[1]] : $match[0], $match[0]);
            },
            $content
        );

        return $processed_content;
    }
public function setDynamicContent(array $params, string $content)
    {
        $processed_content = preg_replace_callback(
            '~\{(.*?)\}~si',
            function ($match) use ($params) {
                return str_replace($match[0], isset($params[$match[1]]) ? $params[$match[1]] : $match[0], $match[0]);
            },
            $content
        );

        return $processed_content;
    }
public function setDynamicContent ( array $ params , string $ content ) { $ processed_content = preg_replace_callback ( '~\{(.*?)\}~si' , function ( $ match ) use ( $ params ) { return str_replace ( $ match [ 0 ] , isset ( $ params [ $ match [ 1 ] ] ) ? $ params [ $ match [ 1 ] ] : $ match [ 0 ] , $ match [ 0 ] ) ; } , $ content ) ; return $ processed_content ; }
Set content dynamically by params
@param $params
@param $content
@return string
Set content dynamically by params