MCQs > IT & Programming > PHP 5 > In the following PHP 7.1 code, which of the given code statements should replace ??? to print the current year as output in the numeric format, i.e. 2017? $date_T = new DateTime(); ??? ?>

PHP 5 MCQs

In the following PHP 7.1 code, which of the given code statements should replace ??? to print the current year as output in the numeric format, i.e. 2017?

$date_T = new DateTime();

???

?>

Answer

Correct Answer:

echo (clone $date_T)->format('Y');  

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it