Test Your Knowledge

  1. Which printf conversion specifier would you use to display a floating-point number?

  2. What printf statement could be used to take the input string “Happy Birthday” and output the string “**Happy”?

  3. To send the output from printf to a variable instead of to a browser, what alternative function would you use?

  4. How would you create a Unix timestamp for 7:11 AM on May 2, 2016?

  5. Which file access mode would you use with fopen to open a file in write and read mode, with the file truncated and the file pointer at the start?

  6. What is the PHP command for deleting the file file.txt?

  7. Which PHP function is used to read in an entire file in one go, even from across the Web?

  8. Which PHP system variable holds the details on uploaded files?

  9. Which PHP function enables the running of system commands?

  10. What is wrong with the following XHTML 1.0 tag: <input type=file name=file size=10>?

See Chapter 7 Answers in Appendix A for the answers to these questions.

Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.