Home > Backend Development > PHP Tutorial > php中smarty页面中怎么获取字符串长度

php中smarty页面中怎么获取字符串长度

WBOY
Release: 2016-06-23 13:53:29
Original
1211 people have browsed it

获取长度并判断长度是否为1,就类似获取数组长度的count方法。


回复讨论(解决方案)

来个活着的啊!

{if strlen($str) eq 1}
...
{else}
...
{/if}

{if strlen($str) eq 1}
...
{else}
...
{/if}


看来基础不好,弄开发太痛苦。这么个问题在网上搜了半天没结果。看来是没人提问这么菜的问题。
谢谢whg4585。
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