the '@' character near the '$' character

This question already has an answer here:

  • What is the use of the @ symbol in PHP? 10 answers

  • @ is the error suppressor.

    NEVER USE IT. You ALWAYS want to capture and handle errors. Error suppression makes it harder for you to debug your code.

    Code should be:

    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;
        }
    }
    

    As Jessica mentioned It supresses errors. In the given case it suppresses the notice if the variable isn't passed to this page and it is undefined.

    Details: http://php.net/manual/en/language.operators.errorcontrol.php

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

    上一篇: mysqli“at”符号的含义/目的

    下一篇: '$'字符旁边的'@'字符