0% found this document useful (1 vote)
814 views3 pages

PHP Quiz

PHP stands for Hypertext Preprocessor. It is a widely-used open source scripting language used primarily for web development. Some key things about PHP include: - PHP code is delimited by <?php ?> tags. The echo statement is used to output text. - PHP syntax is most similar to Perl and C. Variables start with $ symbol. Statements end with semicolons. - Form data can be accessed using the $_GET and $_POST superglobals for GET and POST requests respectively. - PHP supports inclusion of files using the include statement without requiring a file extension. Functions are defined using the function keyword. - MySQL databases can be connected to using mysqli_

Uploaded by

pdfdork
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
814 views3 pages

PHP Quiz

PHP stands for Hypertext Preprocessor. It is a widely-used open source scripting language used primarily for web development. Some key things about PHP include: - PHP code is delimited by <?php ?> tags. The echo statement is used to output text. - PHP syntax is most similar to Perl and C. Variables start with $ symbol. Statements end with semicolons. - Form data can be accessed using the $_GET and $_POST superglobals for GET and POST requests respectively. - PHP supports inclusion of files using the include statement without requiring a file extension. Functions are defined using the function keyword. - MySQL databases can be connected to using mysqli_

Uploaded by

pdfdork
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

What does PHP stand for? Private Home Page *PHP: Hypertext Preprocessor Personal Hypertext Processor Personal Home Page

2.

PHP server scripts are surrounded by delimiters, which? *<?php?> <?php>...</?> <&>...</&> <script>...</script>

3.

How do you write "Hello World" in PHP Document.Write("Hello World"); *echo "Hello World"; "Hello World"; All variables in PHP start with which symbol? & *--> ! $

5.

What is the correct way to end a PHP statement? . New line </php> *--> ;

6.

The PHP syntax is most similar to: JavaScript *Perl and C VBScript

7. How do you get information from a form that is submitted using the "get" method? Request.QueryString; *--> $_GET[]; Request.Form; 8. When using the POST method, variables are displayed in the URL: *False True

9. In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings: False *True 10. Include files must have the file extension ".inc" True *False 11. What is the correct way to include the file "time.inc" ? <?php include file="time.inc"; ?> *--> <?php include "time.inc"; ?> <?php include:"time.inc"; ?> <!-- include file="time.inc" --> 12. What is the correct way to create a function in PHP? new_function myFunction() *function myFunction() create myFunction() 13. What is the correct way to open the file "time.txt" as readable? open("time.txt"); open("time.txt","read"); *fopen("time.txt","r"); fopen("time.txt","r+"); 14. PHP allows you to send emails directly from a script *True False 15. What is the correct way to connect to a MySQL database? *mysqli_connect(host,username,password,dbname); mysqli_db(host,username,password,dbname); mysqli_open(host,username,password,dbname); 16. What is the correct way to add 1 to the $count variable? *--> $count++; ++count count++; $count =+1 17. What is a correct way to add a comment in PHP? *\..\*

<comment></comment> *--> /**/ <!----> 18. PHP can be run on Microsoft Windows IIS(Internet Information Server): *True False 19. In PHP, the die() and exit() functions do the exact same thing. *True False 20. Which one of these variables has an illegal name? *--> $my-Var $myVar $my_Var

You might also like