解析%%之间的数据

Parse data between %%

能否请您告诉我是否可以解析 %% 之间的字符串,而不是显示例如%offerroomlistBox% ,我可以渲染另一个视图来显示我需要的数据。

我从数据库中获取数据,他们的var_dump看起来像这样

我唯一用的是'description'

我用最简单的方式在ckeditor上显示数据

<textarea >
echo $this->templatesList[0]['description']
</textarea >

templatesList 是这样从数据库中取出的列表

    $TemplatesModel = new TemplatesModel();
    $this->view->templatesList = $TemplatesModel->getAll(['where'=>["kind='offers_email'"]]);

试试这个

echo str_replace('%','',$this->templatesList[0]['description']);

要了解 str_replace,请访问此处 https://www.php.net/manual/en/function.str-replace.php