Home

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define(GREETING, PHP is a scripting language);
echo $GREETING;
?>

A. $GREETING

B. no output

C. PHP is a scripting language

D. GREETING

Correct Answer :

B. no output


Constants do not need a $ before them, they are referenced by their variable names itself.

Related Questions

What will be the output of the following PHP code ? <?php $i = 0;while… The date() function returns ___ representation of the current date and/or… What will be the output of the following PHP code ? <?php $i = 2;while… What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME}… Say you want to calculate the date 45 days from the present date which… PHP files have a default file extension of.. To create an object and set the date to JUNE 22, 2013, which one of the… What will be the output of the following PHP code ? <?php $i = 0;while… What will be the output of the following PHP code ? <?php define('GOOD_OCTAL',… What will be the output of the following PHP code ? <?php $i = 5;while… What will be the output of the following PHP code ? <?php define('GREETING_TEST',… What will be the output of the following PHP code ? <?php $color1 =… If the format is F then which one of the following will be returned? Which one of the following function is useful for producing a timestamp… How many ways can a session data be stored? What will be the output of the following PHP code ? <?php $color1 =… What will be the output of the following PHP code? <?php $a = array(A,… What will be the output of the following PHP code ? <?php $i = 0;while… What will be the output of the following PHP code? <?php $cars = array(Volvo,… What will be the output of the following PHP code ? <?php $i = ;while… What will be the output of the following PHP code? <?php $fname = array(Peter,… If session.use_cookie is set to 0, this results in use of.. What will be the output of the following PHP code? <?php $a = array(red,… What will be the output of the following PHP code ? <?php $i = 2;while… What will be the output of the following PHP code? <?php $cars = array(Volvo,… Which directive determines how the session information will be stored? Which of following variables can be assigned a value to it?i) $3helloii)… What is the default number of seconds that cached session pages are made… Which of the following PHP statements will output Hello World on the screen?i)… What will be the output of the following PHP code ? <?php define(GREETING,…