Discussion :: PHP - CS
- Which of the following is the right way to use the DateTime class?
A.
$date = get_Class(DateTime); |
B.
$date = class DateTime; |
C.
$date = new DateTime(); |
D.
$date = new class DateTime(); |
Answer : Option C
Explanation :
The way you use the DateTime class is like any other class: instantiate an object, and store it in a variable.
Be The First To Comment