Examveda
Examveda

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

A. Welcome to Narnia

B. greeting

C. GREETING

D. ERROR

Answer: Option D

Solution(By Examveda Team)

By default constants are case sensitive. Hence an error will arise.

This Question Belongs to PHP >> Functions

Join The Discussion

Related Questions on Functions