What will be the output of the following PHP code?
<?php
echo (checkdate(4,31,2010) ? ‘Valid’ : ‘Invalid’);
?>
a) TRUE
b) FALSE
c) Valid
d) Invalid
Answer: d
Explanation: The function checkdate() is used to validate a Gregorian date. In the program, April has 30 days and the above date is 31 therefore Invalid is returned.
Related Posts
What would be behaviour if the constructor has a return type?
What would be the behaviour if one parameterized constructor is explicitly defined?
What is not the use of “this” keyword in Java?
What is true about protected constructor?
Abstract class cannot have a constructor.
What is true about constructor?
What is true about Class.getInstance()?
Join The Discussion