Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个:
if ($image1 !=='') { //Div here }
但是当我将 div 放在大括号之间时,我遇到了解析错误。一定有某种方式,这需要是我做得不好......?
你可以这样做:
if ($image1 !== '') { echo '<div>foo</div>'; }
或者,您可以在访问 HTML 代码时告诉服务器停止解析 PHP,然后在完成后告诉它重新开始解析:
if ($image1 !== '') { ?> <div>foo</div> <?php }