PHP Reviewer Flashcards
Q 1 - Which of the following is correct about PHP?
A - PHP can access cookies variables and set cookies.
B - Using PHP, you can restrict users to access some pages of your website.
C - It can encrypt data.
D - All of the above.
D - All of the above.
Q 2 - Which of the following type of variables have only two possible values either true or false?
A - Integers
B - Doubles
C - Booleans
D - Strings
C - Booleans
Q 3 - Which of the following magic constant of PHP returns function name?
A - LINE
B - FILE
C - __FUNCTION__
D - CLASS
C - FUNCTION
Q 4 - Which of the following function is used to locate a string within a string?
A - search()
B - locate()
C - strpos()
D - None of the above.
C - strpos()
Q 5 - Which of the following variable is used for the PHP script name?
A - $_PHP_SELF
B - $SELF
C - $PHP
D - None of the above.
A - $_PHP_SELF
Q 6 - If there is any problem in loading a file then the require() function generates a warning but the script will continue execution.
A - true
B - false
B - false
Q 7 - Which of the following is used to create a session?
A - session_start() function
B - $_SESSION[]
C - isset() function
D - session_destroy() function
A - session_start() function
Q 8 - Which of the following is used to destroy the session?
A - session_start() function
B - $_SESSION[]
C - isset() function
D - session_destroy() function
D - session_destroy() function
Q 9 - Which of the following method of Exception class returns the code of exception when error occured?
A - getMessage()
B - getCode()
C - getFile()
D - getLine()
B - getCode()
Q 10 - Which of the following method acts as a destructor function in a PHP class?
A - class_name()
B - __destruct
C - destructor
D - None of the above.
B - __destruct
a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.
PHP
What does PHP stand for
PHP: Hypertext Preprocessor
What are the common usage of PHP?
- PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
- PHP can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.
- You add, delete, modify elements within your database thru PHP.
- Access cookies variables and set cookies.
- Using PHP, you can restrict users to access some pages of your website.
- It can encrypt data.
In how many ways you can embed PHP code in an HTML page?
All PHP code must be included inside one of the three special markup tags ate are recognised by the PHP Parser.
<?php PHP code goes here ?>
<? PHP code goes here ?>
PHP code goes here
Most common tag is the <?php…?>
- final and most immediate way to affect PHP’s functionality
- read each time PHP is initialized
php.ini
The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as?
‘escaping to PHP.’