Multiple choice php

What is the correct way to include the file "time.inc" ?

  1. <!--include file="time.inc"-->

  2. <?php include_file("time.inc"); ?>

  3. <?php require("time.inc"); ?>

  4. <% include file="time.inc" %>

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The require() function includes a file and produces a fatal error if the file cannot be included. Option A uses HTML comment syntax (invalid for PHP), Option B uses a non-existent function include_file(), and Option D uses ASP syntax (<% %>). The correct PHP syntax is require() or include().