'$'字符旁边的'@'字符

这个问题在这里已经有了答案:

  • PHP中@符号的用法是什么? 10个答案

  • @是错误抑制器。

    永远不要使用它。 你总是想要捕捉和处理错误。 错误抑制使您难以调试代码。

    代码应该是:

    if (isset($_REQUEST['j']) and !empty($_REQUEST['j'])) {
        header("Location: http://atmst.net/utr64.php?j=" . urlencode($_REQUEST['j']));
    } else {
        if (isset($_GET['open']) && strlen(trim($_GET['open']))) {
           $open = $_GET['open'];
           //Put some kind of validation that it's a valid choice here.
           header("Location: http://atmst.net/$open ");
            exit;
        }
    }
    

    正如杰西卡所提到的,它抑制了错误。 在给定的情况下,如果变量未传递给此页面并且未定义,它会禁止通知。

    详情:http://php.net/manual/en/language.operators.errorcontrol.php

    链接地址: http://www.djcxy.com/p/57703.html

    上一篇: the '@' character near the '$' character

    下一篇: What is the php @ sign for