2
<meta property="og:image" content="{$Image|regex_replace:"/(div class=+)/i":""}" />
我想为此添加撇号,以便我可以将它们替换为无。我将如何实现这一目标?在smarty中用preg_replace替换撇号
<meta property="og:image" content="{$Image|regex_replace:"/(div class=+)/i":""}" />
我想为此添加撇号,以便我可以将它们替换为无。我将如何实现这一目标?在smarty中用preg_replace替换撇号
{$Image|replace:"'":$var}
只是柜面你仍然不知道Smarty的方式做到这一点
为什么你不只是做PHP的一面呢?附:上帝,聪明是丑陋的... –
+1为Briedis。我同意使用smarty执行php操作是愚蠢的......而且我是Smarty的辩护人。限制你的视图来显示逻辑。 – rdlowrey
我继续把它放在我的php中。找出在PHP中执行它的代码是一个简单的str_replace(“'”,'',$ var); – wowzuzz