if-then-else_替代的if-then-else语法

if-then-else

if-then-else

There's a small error in the PHP certification guide in the alternative if-then-else syntax code.

PHP认证指南中的if-then-else替代语法代码中有一个小错误。

This alternative syntax goes like: < ?php if (true) : echo 'it is true'; else : echo 'so not true'; endif; ?>

这种替代语法如下:<?php if(true):echo'它是真的'; else:回声“所以不是真的”; 万一; ?>

In the example given in the cert guide, the ; after endif is missing, which will cause a parse error.

在证书指南中给出的例子中, ; endif丢失后,将导致解析错误。

Tell your friends about this post on Facebook and Twitter

FacebookTwitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/alternative-if-then-else-syntax/

if-then-else

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值