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

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

WBOY
Release: 2016-06-13 10:07:17
Original
946 people have browsed it

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template