smarty支持php的系统函数可以直接使用{if in_array($str, $arr) || strpos($str, $string)} yes {else} no{/if} 转载于:https://www.cnblogs.com/jiechn/p/4311624.html