Which of the following statements is NOT a valid way to crea
Which of the following statements is NOT a valid way to create a timestamp named $birthdate that represents December 2, 1969?
a.
$birthdate = mktime(0, 0, 0, 12, 2, 1969);
b.
$birthdate = mktime(12, 2, 1969);
c.
$birthdate = strtotime(\'1969-12-02\');
d.
$birthdate = strtotime(\'12/02/1969\');
| a. | $birthdate = mktime(0, 0, 0, 12, 2, 1969); |
| b. | $birthdate = mktime(12, 2, 1969); |
| c. | $birthdate = strtotime(\'1969-12-02\'); |
| d. | $birthdate = strtotime(\'12/02/1969\'); |
Solution
SYNTAX
=> mktime(hour,minute,second,month,day,year,is_dst);
a. $birthdate = mktime(0, 0, 0, 12, 2, 1969); is VALID
b. $birthdate = mktime(12, 2, 1969); is INVALID
SYNTAX
=> int strtotime ( string $time [, int $now] );
c. $birthdate = strtotime(\'1969-12-02\');
d. $birthdate = strtotime(\'12/02/1969\');
are VALID
