ExamVeda
Login
Home
1
What will be the output of the following PHP code?
<?php
    echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');
?>
Discuss
Answer & Solution
Answer: Option D
Solution:
April has 30 days and the above date is 31 therefore Invalid is returned.
2
The date() function returns ___ representation of the current date and/or time.
Discuss
Answer & Solution
Answer: Option B
Solution:
The prototype of this function is: string date(string format [, int timestamp]).
3
Which one of the following format parameter can be used to identify timezone?
Discuss
Answer & Solution
Answer: Option C
Solution:
When the format is E the timezone is identified and returned…example America/New_York.
4
If the format is F then which one of the following will be returned?
Discuss
Answer & Solution
Answer: Option A
Solution:
Day of month, with leading zero is represented by D; Daylight saving time by I; Day of month, without zeros by j.
5
What will be the output of the following code? If say date is 22/06/2013.
<?php
    echo "Today is ".date("F d, Y")
?>
Discuss
Answer & Solution
Answer: Option D
Solution:
F is the parameter for complete text representation of month, d for day of month, and Y for 4 digit representation of year.
6
Which one of the following function is useful for producing a timestamp based on a given date and time.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
7
Which function displays the web page’s most recent modification date?
Discuss
Answer & Solution
Answer: Option B
Solution:
The getlastmod() function returns the value of the page’s Last Modified header or FALSE in the case of an error.
8
What will be the output of the following PHP code? If say date is 22/06/2013.
<?php
    printf( date("t") )
?>
Discuss
Answer & Solution
Answer: Option A
Solution:
The t parameter is used to determine the number of days in the current month.
9
Say you want to calculate the date 45 days from the present date which one of the following statement will you use?
Discuss
Answer & Solution
Answer: Option C
Solution:
The strtotime() function and GNU date syntax is used to calculating the date x days from the present date.
10
To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?
Discuss
Answer & Solution
Answer: Option D
Solution:
The dateTime() method is class constructor. You can set the date either at the time of instantiation or later by using a variety of mutators.