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

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

问题描述

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

What does the symbol : mean in PHP?

推荐答案

PHP 为其某些控制结构提供了替代语法;即,if、while、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天全站免登陆