PHP Quiz

Ace your homework & exams now with Quizwiz!

All variables in PHP start with which symbol? ! & $ #

$

How do you get information from a form that is submitted using the "get" method? Request.Form; GET_INFO $_GET[]; Request.QueryString;

$_GET[];

Which superglobal variable holds information about headers, paths, and script locations? $_GLOBALS $_SESSION $_GET $_SERVER

$_SERVER

How do you create an array in PHP? $cars = array("Volvo", "BMW", "Toyota"); $cars = "Volvo", "BMW", "Toyota"; $cars = array["Volvo", "BMW", "Toyota"]; upupandarray["apple", "banana", "cherry"]

$cars = array("Volvo", "BMW", "Toyota");

What is the correct way to add 1 to the $count variable? $count =+1 ++count $count++; count+

$count++;

Which one of these variables has an illegal name? $myVar $my_Var $my-Var

$my-Var

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

<?php include "time.inc"; ?>

In PHP, the only way to output text is with echo.

False

Include files must have the file extension ".inc"

False

What is the correct way to open the file "time.txt" as readable? fopen("time.txt","r+"); open("time.txt"); open("time.txt","read"); fopen("time.txt","r");

fopen("time.txt","r");

What is a correct way to add a comment in PHP? ... /*...*/ *\...\* ##

/*...*/

What is the correct way to end a PHP statement? : ; , </php>

;

PHP server scripts are surrounded by delimiters, which?

<?php...?>

Which operator is used to check if two values are equal and of same data type? == === != =

===

When using the POST method, variables are displayed in the URL: True False

False

PHP stand for is the acronyem for which of the following? PHP: Hypertext Preprocessor Private Home Page Proprietaty Home Page Personal Hypertext Processor

PHP: Hypertext Preprocessor

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

Perl and C

In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings: True False

True

PHP allows you to send emails directly from a script

True

PHP can be run on Microsoft Windows IIS(Internet Information Server):

True

The die() and exit() functions do the exact same thing.

True

The if statement is used to execute some code only if a specified condition is true

True

How do you write "Hello World" in PHP? "Hello World"; printf "Hello World"; Document.Write("Hello World"); echo "Hello World";

echo "Hello World";

What is the correct way to create a function in PHP? new_function myFunction() function myFunction() create myFunction() getthefunc()out

function myFunction()

How do you create a cookie in PHP? createcookie Set oven to 375 setcookie() makecookie()

setcookie()


Related study sets

Philosophy 103 (5. Psychological and Ethical Egoism)

View Set

MLT Chemistry/Special Chemistry Quiz Review

View Set

Chapter 6 and Chapter 4 Test (Psychology 101)

View Set

ACCESS CH.2 Tables, Keys, and, Relationships

View Set

Hydraulics and Pneumatics masterlist 1.1

View Set