Home >Backend Development >PHP Tutorial >Smarty中怎么判断一个变量是字符串还是数组呢

Smarty中怎么判断一个变量是字符串还是数组呢

WBOY
WBOYOriginal
2016-06-13 10:07:17947browse

Smarty中如何判断一个变量是字符串还是数组呢?
有一个变量比如是$data

在模板中怎么判断他是字符串还是数组呢?

------解决方案--------------------
{if is_array($data)}
yes
{else}
no
{/if}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn