The date function requires the format string in quotes to return the current year.
Step 2: Evaluate each option
echo date("Y"); correctly calls date("Y") to output the year. echo "date(Y)"; prints the string literally. echo date(Y, Y); misses quotes causing undefined constants and wrong output (1970). echo "Y"; prints letter Y only.
Final Answer:
echo date("Y"); -> Option A
Quick Check:
Correct date format string = A [OK]
Hint: Use quotes around format in date() function [OK]
Common Mistakes:
Omitting quotes around format string
Printing function call as string
Confusing output with literal text
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.