PHP FINAL QUESTIONS AND ANSWERS
What does PHP stand for today? - Answers -PHP: Hypertext Preprocessor
PHP server scripts are surrounded by delimiters, which? - Answers -<?php ... ?>
How do you write "Hello World" in PHP to display on screen? - Answers -echo "Hello
World";
All variables in PHP start with which symbol? - Answers -$
What is the correct way to end a PHP statement? - Answers -;
T or F: In PHP you can use both single and double quotes for strings. - Answers -True
What is the correct way to create a function in PHP? - Answers -function
myFunctionName()
What is a correct way to add a comment in PHP? - Answers -/*...*/
T or F: PHP can be run on Linux. - Answers -True
Which one of these variables has an illegal name? - Answers -$my-Var
T or F: in PHP, all variable names are case-sensitive. - Answers -True
_____ are containers for storing information. - Answers -Variables
Which code example is correct for assigning a text value to a variable?
1) ?php
2) echo "My dog is"$color
3) $txt = "Hello World";
4) $x = 22 - Answers -3) $txt = "Hello World";
T or F: PHP has no command for declaring a variable. It is created the moment you first
assign a value to it. - Answers -True
What are the 3 different variable scopes in PHP? - Answers -Global, local, and static.
T or F: The echo statement can be used with or without parentheses: echo or echo() -
Answers -True
How do you write "This is fun" using the print statement? - Answers -print "This is fun";
What does PHP stand for today? - Answers -PHP: Hypertext Preprocessor
PHP server scripts are surrounded by delimiters, which? - Answers -<?php ... ?>
How do you write "Hello World" in PHP to display on screen? - Answers -echo "Hello
World";
All variables in PHP start with which symbol? - Answers -$
What is the correct way to end a PHP statement? - Answers -;
T or F: In PHP you can use both single and double quotes for strings. - Answers -True
What is the correct way to create a function in PHP? - Answers -function
myFunctionName()
What is a correct way to add a comment in PHP? - Answers -/*...*/
T or F: PHP can be run on Linux. - Answers -True
Which one of these variables has an illegal name? - Answers -$my-Var
T or F: in PHP, all variable names are case-sensitive. - Answers -True
_____ are containers for storing information. - Answers -Variables
Which code example is correct for assigning a text value to a variable?
1) ?php
2) echo "My dog is"$color
3) $txt = "Hello World";
4) $x = 22 - Answers -3) $txt = "Hello World";
T or F: PHP has no command for declaring a variable. It is created the moment you first
assign a value to it. - Answers -True
What are the 3 different variable scopes in PHP? - Answers -Global, local, and static.
T or F: The echo statement can be used with or without parentheses: echo or echo() -
Answers -True
How do you write "This is fun" using the print statement? - Answers -print "This is fun";