<?php
echo $Variable;
?>
**// I would like to check if the variable is empty, using but if() statements but more secure than...**
if($var == "")
有没有可能检查变量是否为空,比这更安全?
发布于 2011-02-25 05:52:31
empty()
发布于 2011-02-25 05:53:09
if(!isset($var) || $var == "")
{
//$var is empty.
}
^这就是我所使用的,如果你还没有‘初始化’它,它也会包含在内。
*编辑-反映注释
发布于 2011-02-25 05:54:36
If (!isset($var) || empty($var))
https://stackoverflow.com/questions/5110915
复制相似问题