php echo以'@'开头以显示变量,
示例:
<?php echo @$user_profile['id'];?>
为什么在这里使用@符号?
答案 0 :(得分:5)
That is just suppressing notices when the variable is not available.
See http://php.net/manual/en/language.operators.errorcontrol.php for more info.
PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
答案 1 :(得分:-1)
PHP支持一种错误控制运算符:at符号(@)。与PHP中的表达式一起使用时,该表达式可能生成的任何错误消息都将被忽略。