Home » PHP » PHP Constants » Question
  1. What will be the output of the following PHP code ?
    <?php
    define('ATTENTION_TEXT', 'Interview mania is good website.', true);
    echo ATTENTION_TEXt;
    $changing_var = 'text';
    echo constant('ATTENTION_' . strtoupper($changing_var));
    ?>
    1. Nothing
    2. Interview mania is good website.
    3. Interview mania is good website.Interview mania is good website.
    4. Error
    5. None of these
Correct Option: C

echo constant(c) output c, and c here is the concatenation of ATTENTION_ and $changing_var with . operator.



Your comments will be displayed only after manual approval.