Register|Login

Have a question? Click here to ask the community.

Quiz 8 – Include

| In: PHP Quizzes | 18,995 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! :)

1. A common practice for naming files that are to be included is to use the .php extension?

True
False

2. The include command takes a file name and simply inserts that file’s contents into the script/document that issued the include command?

True
False

3. Which of the following is the correct way to use the include command?

include(“example.php”)
include “example.php”;
include(“example.php”);
None of the above

4. Based on the following two files, index.php and content.php, what will be displayed in your browser when visiting index.php?

File content.php contains:
<?php
echo “Hello World”;
?>

File index.php contains:
<html>
<body>
<?php
include(“content.php”);
?>
<br>Hello Earth
</body>
</html>

Hello World
Hello Earth

Hello Earth
Hello World

Hello World
Hello Earth

5. Based on the following two files, index.php and content.php, what will be displayed in your browser when visiting index.php?

File content.php contains:
<?php
echo “Hello World”;
?>

File index.php contains:
<html>
<body>
<br>Hello Earth
<?php
include(“content.php”);
?>
</body>
</html>

Hello World
Hello Earth

Hello Earth
Hello World

Hello World
Hello Earth

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 3 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments