什么是“:"在PHP中? [英] What is ":" in PHP?

查看:77
本文介绍了什么是“:"在PHP中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

符号:在PHP中是什么意思?

What does the symbol : mean in PHP?

推荐答案

PHP为它的某些控制结构提供了一种替代语法.即,是否,for,foreach和switch.在每种情况下,替代语法的基本形式都是将左大括号更改为冒号(:),将右大括号更改为endif;,endwhile;,endfor;,endforeach;或endswitch;.

PHP offers an alternative syntax for some of its control structures; namely, if, while, for, foreach, and switch. In each case, the basic form of the alternate syntax is to change the opening brace to a colon (:) and the closing brace to endif;, endwhile;, endfor;, endforeach;, or endswitch;, respectively.

这篇关于什么是“:"在PHP中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆