Examveda
Examveda

What will be the output of the following PHP code ?
<?php
function constant()
{
    define("GREETING", "Welcome to Narnia",true);
    echo greeting;
}
?>

A. Welcome to Narnia

B. greeting

C. GREETING

D. ERROR

Answer: Option A

Solution(By Examveda Team)

By default constants are case sensitive. But the third parameter in define(), if set to true, makes constants case insensitive.

This Question Belongs to PHP >> Functions

Join The Discussion

Comments ( 1 )

  1. Raham Sher
    Raham Sher :
    4 years ago

    Its deprecated (true/false)

Related Questions on Functions