PHP 7

COEP
Lets Crack Online Exam

IT Interview Exam Paper: PHP 7

Subject: PHP 7

Part 7: List for questions and answers of PHP

 

Q1. The filesize() function returns the file size in___.

a) bits

b) bytes

c) kilobytes

d) gigabytes

 

Q2. Which one of the following PHP function is used to determine a file’s last access time?

a) fileltime()

b) filectime()

c) fileatime()

d) filetime()

 

Q3. Which one of the following function is capable of reading a file into an array?

a) file()

b) arrfile()

c) arr_file()

d) file_arr()

 

Q4. Which one of the following function is capable of reading a file into a string variable?

a) file_contents()

b) file_get_contents()

c) file_content()

d) file_get_content()

 

Q5. Which one of the following function is capable of reading a specific number of characters form a file?

a) fgets()

b) fget()

c) fileget()

d) filegets()

 

Q6. Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?

a) fgetsh()

b) fgetsp()

c) fgetsa()

d) fgetss() 

 

Q7. Which one of the following function outputs the contents of a string variable to the specified resource?

a) filewrite()

b) fwrite()

c) filewrites()

d) fwrites()

 

Q8. Which function sets the file filename’s last-modified and last-accessed times?

a) sets()

b) set()

c) touch()

d) touched()

 

Q9. Which function is useful when you want to output the executed command’s result?

a) out_cmm()

b) out_system()

c) cmm()

d) system()

 

Q10. Which one of the following function reads a directory into an Array?

a) scandir()

b) readdir()

c) scandirectory()

d) readdirectory()

 

Q11. 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

 

Q12. The date() function returns ___ representation of the current date and/or time.

a) Integer

b) String

c) Boolean

d) Float 

 

Q13. Which one of the following format parameter can be used to identify timezone?

a) T

b) N

c) E

d) I

 

Q14. If the format is F then which one of the following will be returned?

a) Complete text representation of month

b) Day of month, with leading zero

c) Daylight saving time

d) Day of month, without zeros

 

Q15. What will be the output of the following code? If say date is 22/06/2013.

<?php

echo “Today is “.date(“F d, Y”)

?>

a) Today is 22 June, 2013

b) Today is 22-06-2013

c) Today is 06-22-2013

d) Today is June 22, 2013

 

Q16. Which one of the following function is useful for producing a timestamp based on a given date and time.

a) time()

b) mktime()

c) mrtime()

d) mtime()

 

Q17. Which function displays the web page’s most recent modification date?

a) lastmod()

b) getlastmod()

c) last_mod()

d) get_last_mod()

 

Q18. Say you want to calculate the date 45 days from the present date which one of the following statement will you use?

a) totime(“+45”)

b) totime(“+45 days”)

c) strtotime(“+45 days”)

d) strtotime(“-45 days”) 

 

Q19. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?

a) $date = Date(“22 JUNE 2013”)

b) $date = new Date(“JUNE 22 2013”)

c) $date = DateTime(“22 JUNE 2013”)

d) $date = new DateTime(“22 JUNE 2013”)

 

Q20. What will be the output of the following PHP code? If say date is 22/06/2013.

<?php

printf( date(“t”) )

?>

a) 30

b) 22

c) JUNE

d) 2013 

 

Part 7: List for questions and answers of PHP

 

Q1. Answer: b

 

Q2. Answer: c

 

Q3. Answer: a

 

Q4. Answer: b

 

Q5. Answer: a

 

Q6. Answer: d

 

Q7. Answer: b

 

Q8. Answer: c

 

Q9. Answer: d

 

Q10. Answer: a

 

Q11. Answer: d

 

Q12. Answer: b

 

Q13. Answer: c

 

Q14. Answer: a

 

Q15. Answer: d

 

Q16. Answer: b

 

Q17. Answer: b

 

Q18. Answer: c

 

Q19. Answer: d

 

Q20. Answer: a