0
if (isset($_SESSION['location']) AND !empty($_SESSION['location']))
工作,同时
if (isset($_SESSION['location']) && !empty($_SESSION['location']))
不?
我正在使用eval()在wordpress页面中处理PHP。对于我而言,为什么PHP扼流圈&&
而不是AND
是没有意义的。文档没有特别说明什么,也没有其他人似乎有明确的答案。
感谢您的输入。
编辑
不在于它真的很重要,但我使用eval()在WP模板:
$sContent = get_the_content();
$sContent = apply_filters('the_content', $sContent);
$sContent = str_replace(']]>', ']]>', $sContent);
eval(' ?>'. $sContent .'<?php ');
你在哪里或如何使用'eval'? WP模板页面中的 – 2011-03-25 19:50:52
,请参阅编辑。 – Brenden 2011-03-25 19:57:03
给出的代码假定'$ _SESSION ['location']'包含一个值:http://codepad.org/0FIzG13c – 2011-03-25 19:57:14