Q:
PHP find output programs (define Constant) | set 1
belongs to collection: PHP Find Output Programs
PHP Find Output Programs
- PHP find output programs (basics) | set 1
- PHP find output programs (basics) | set 2
- PHP find output programs (basics) | set 3
- PHP find output programs (Superglobals) | set 1
- PHP find output programs (conditional statements) | set 1
- PHP find output programs (conditional statements) | set 2
- PHP find output programs (conditional statements) | set 3
- PHP find output programs (switch Statement) | set 1
- PHP find output programs (switch Statement) | set 2
- PHP find output programs (switch Statement) | set 3
- PHP find output programs (Operators) | set 1
- PHP find output programs (Operators) | set 2
- PHP find output programs (Operators) | set 3
- PHP find output programs (Loops) | set 1
- PHP find output programs (Loops) | set 2
- PHP find output programs (Loops) | set 3
- PHP find output programs (Loops) | set 4
- PHP find output programs (Arrays) | set 1
- PHP find output programs (Arrays) | set 2
- PHP find output programs (Arrays) | set 3
- PHP find output programs (User-defined functions) | set 1
- PHP find output programs (User-defined functions) | set 2
- PHP find output programs (User-defined functions) | set 3
- PHP find output programs (String Functions) | set 1
- PHP find output programs (String Functions) | set 2
- PHP find output programs (Number Functions) | set 1
- PHP find output programs (Math Functions) | set 1
- PHP find output programs (Math Functions) | set 2
- PHP find output programs (Date and Time) | set 1
- PHP find output programs (define Constant) | set 1
- PHP find output programs (static variables, classes, methods) | set 1
- PHP find output programs (static variables, classes, methods) | set 2
- PHP find output programs (Regular Expressions) | set 1
- PHP find output programs (Exceptions) | set 1
- PHP find output programs (Exceptions) | set 2
- PHP find output programs (Filters) | set 1
- PHP find output programs (Filters) | set 2
- PHP find output programs (JSON) | set 1
- PHP find output programs (const Keyword) | set 1
- PHP find output programs (Class & Objects) | set 1
- PHP find output programs (Class & Objects) | set 2
- PHP find output programs (Class & Objects) | set 3
- PHP find output programs (Constructors and Destructors) | set 1
- PHP find output programs (Constructors and Destructors) | set 2
- PHP find output programs (Constructors and Destructors) | set 3
- PHP find output programs (Inheritance) | set 1
- PHP find output programs (Inheritance) | set 2
- PHP find output programs (Inheritance) | set 3
Answer 1:
Output:
Explanation:
The above program will generate PHP Notice because there is no need to use $ symbol with a constant defined by define() function.
Answer 2:
Output:
Explanation:
In the above program, we defined 2 constants A and B initialized with 10 and 20 respectively. Here, we used 'a' and 'b' instead of 'A' and 'B'. Here, we defined case sensitive constants, then the value of variable $C will be 0.
Answer 3:
Output:
Explanation:
In the above program, we defined 2 case in-sensitive constants A and B initialized with 10 and 20 respectively using built-in function define(). Here, we used 'a' and 'b' instead of 'A' and 'B'. Here we defined case in-sensitive constants, then the value of variable $C will be 30.
Answer 4:
Output:
Explanation:
The above program will print 20 on the webpage. In the above program, we defined two variables A and B, initialized with "Hello World" and 20 respectively.
In the above expression, we used the '+' operator, which will not concatenate the string constant with integer constant, for concatenation we need to use dot '.' operator. Then the value of the $C variable will be 20.
Answer 5:
Output:
Explanation:
The above program will print "a20" on the webpage. In the above program, we defined a case sensitive constant 'A' and defined an in-case sensitive constant 'B'.
$C = a .b;
In the above statement, we used 'a' instead of 'A'. That's why the value A will not be used, and the final value of variable $C will be "a20" on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer