1.

Which method is simply an object-oriented version of date()?(a) DateTime::format()(b) DateTime::modify()(c) DateTime::setTime()(d) DateTime::setDate()The question was posed to me during an online exam.I want to ask this question from Working with Dates topic in division File and Session Handling in PHP of PHP

Answer»

Correct option is (a) DateTime::FORMAT()

To explain: The format() method is SIMPLY an object-oriented version of DATE(). It takes $dateFormat as an argument. $dateFormat is a string consisting of the same date formatting characters accepted by the PROCEDURAL date() function.



Discussion

No Comment Found

Related InterviewSolutions