Web Application Development 1 ALL

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Arithmetic

This is an example of: $Pui % $haha;


Operator
AND The logical operator && stands for?
The correct answers are: 'name',
It is used to access submitted form values
$_POST
188 Determine the exact output of the code:
Array is special variable that can handle more than
TRUE
one value.
Unix, Linux, Windows and others MySQL runs on which operating systems?
Call By Value What will happen in this function call?
True or False
TRUE PHP can be run on Microsoft Windows IIS(Internet
Information Server):
Price Key Categories: free of charge.
What is the output of the following? echo
strcmp('first', 'second'), ", "; echo strcmp('44',
1, 0, -1, 1
'054'), ", "; echo strcmp('0x80', 'a'), ", "; echo
strcmp('a', 'A');
Which of the following displays the unique values
of the column.
Distinct
Select ________ dept_name
from instructor;
Array ( [3] => blue [4] => blue [5] => blue
[6] => blue ) What will be the output of the following PHP code?
Array ( [0] => red )
$ Variables in PHP must begin with what symbol?
Allow for multiple items of the same type to be
Compound Datatypes
aggregated under a single representative entity.
Which is the correct way to write a multiple line
/* .. */
PHP comment?
What is the output of the following? echo
substr("abcdef", -2), ', '; echo substr("abcdef", 4), ',
Ef, ef, de, , cde '; echo substr("abcdef", -3, -1), ', '; echo
substr("abcdef", 4, -2), ', '; echo substr("abcdef", 2,
-1)
Multiple Choice. Select the best answer
.php If a source file contains PHP code, what extension
should be used?
It is an attribute that must be used in the form tag
enctype
in specifying an input file type
PHP variables need to be declared before adding
FALSE
a value to it?
True or False
FALSE
In PHP, the only way to output text is with echo.
$my-Var Which one of these variables has an illegal name?
It is a field that contains a unique identifier for each
Primary key
record in a primary table
CREATE TABLE table_name Which one of the following statements is used to
(column_namecolumn_type); create a table?
What is the correct method to use in Javascript
sort()
Sorting Arrays?
True or False
TRUE The echo command is a means of outputting text
to the web browser?
FOREACH, EXPLODE and MAIL are examples of
FALSE
crazy functions.
And the Founder/Developer of PHP is
RasmusLerdorf
____________.
Array values are keyed by ______ values (called
indexed arrays) or using ______ values (called
Integer, String
associative arrays). Of course, these key methods
can be combined as well.
include("int.php") How to use the include function?
Which of the following is the incorrect way to
$a_Number = 9
declare a PHP variable?
preg_match() This function is used for checking or searching for
check() patterns in a given text
Key Categories: more libraries and thousands of
Power
functions
One that declared outside a function and is
Global Variable
available to all.
It is placed within the code of a loop to cause the
break
program to stop the loop statement.
True or False
FALSE When a variable is declared, it can only be used 1
time in your PHP source file?
78 What will the following script output?
It is a command used to add individual records in a
INSERT, INTO
table.
True or False
TRUE
All variables in PHP start with a $(dollar) sign?
PHP server scripts are surrounded by delimiters,
<?php...?>
which?
/ *...* / Multiple Choice. Select the best answer
Multiple Choice. Select the best answer
$
All variables in PHP start with which symbol?
Multiple Choice. Select the best answer
the end of a PHP statement or
What does a semicolon signify at the end of a
instruction
instruction or statement?
Insert Which of the following can add a row to a table?
Function is used to convert a human readable
strtotime()
string to a Unix time.
Format character of Date function that display a
j full textual representation of the day of the week
such us Sunday to Saturday
mysql_query() This command sends active query to the database
The following condition will return TRUE or FALSE
TRUE
: (4 >= 4 || 8 < 1)
The following are examples of =, +=, *=, /=, .=
Assignment
_______ Operators
5 strlen("seven"); what is the output?
; What is the statement terminator for PHP?
mysql_connect / mysqli_connect It opens a connection to a MySQL database server
PERL PHP is based on C rather than ______.
Managing of cookies can be done using this
setcookie()
function
count What functions count elements in an array?
1 What will be the output of the following PHP code?
Array ( [0] => red [1] => green [2] => blue
What will be the output of the following PHP code?
[3] => yellow )
True or False.
FALSE When using the POST method, variables are
displayed in the URL:
Sorts by value in reverse order; keeps the same
arsort()
key
Assuming the table and fields below exists, what is
wrong with the following mysql query example:
Nothing, everything is fine mysql_query("INSERT INTO contacts (firstName,
lastName, phoneNumber)
VALUES ('Robert', 'Smith', '123-983-2929')");
1994 In what year does PHP was developed?
mysql_query("SELECT * FROM table");
How will you able to retrive data in your table?
mysqli_query("SELECT * FROM table");
AMA University What will be the output of the following PHP code?
Infinitive What is the output of the following code?
In PHP you can use both single quotes ( ' ' ) and
/ *...* /
double quotes ( " " ) for strings:
Multiple Choice. Select the best answer
PHP: Hypertext Preprocessor
What does PHP stand for?
It is the symbol used to mark the start of the string
^
in regular expressions
One of the parameters to represent the day of the
d
month
NOT The logical operator ! stands for?
TRUE Date() is a function that can also access time.
Which is the incorrect way to start a single line
/* .. */
PHP comment?
Which one of the following function is useful for
mktime() producing a timestamp based on a given date and
time.
Multiple Choice. Select the best answerHow do
<?php … ?>
you start the standard form PHP scripting block?
A What will be the output of the following PHP code?
/* .. */ Multiple Choice. Select the best answer
Multiple Choice. Select the best answerWhat data
integer (a number variable) type will PHP automatically convert the following
variable to:?
What will be displayed in a browser when the
Hello YouTube
following PHP code is executed:
It's a function returns the Unix timestamp for a
mktime()
date.
Multiple Choice. Select the best answer
2 How many single line commenting types are
there?
OR The logical operator || stands for?
The following are examples of =, !=, === ______
Equality
Operators
IIIS7 Software Requirements: Web Server except for :
Determine the exact output of the code:
3 $num = 3.14;
echo floor($num);
It is the default server name used to connect in
Localhost
MySQL server.
Sort Sorts by value; assign new numbers as the
sort()
keys.
Some sort of client program to access
To use MySQL on your computer, you'll need?
the databases
The ________ clause is used to list the attributes
Select
desired in the result of a query.
PHP's numerically indexed array begin with
0
position __.
; Multiple Choice. Select the best answer
The following condition will return TRUE or
FALSE
FALSE: (4 >= 4 && 8 < 1)
Assume you would like to sort an array in
ascending order by value while preserving key
asort()
associations. Which of the following PHP sorting
functions would you use?
Multiple Choice. Select the best answer
Perl and C
The PHP syntax is most similar to:
It is a file function mode that is used to open a file
fopen()
for reading, writing or appending.
I like Volvo, BMW and Toyota. What will be the output of the following PHP code?
Which is identified as a special variable, which can
Array
store multiple values in one single variable?
Determine the exact output of the code $str = "The
16 quick brown fox jumps over the the lazy dog"; echo
strpos($str, 'fox');
To make the string's first character What is the function of the ucfirst and lcfirst
uppercase or lowercase, respectively functions?
Hello World What will be displayed in a browser when the
Welcome to the USA following PHP code is executed.
Error What will be the output of the following PHP code?
It is a function that saves the uploaded file
move_uploaded_file()
permanently into the server.
Print Is a function also use for outputting strings.
True or False
FALSE Writing comments is considered a bad
programming practice?
It specifies the name of the field in the form to be
file
processed by the $_FILES
It reports the error message from the last failed
mysql_error / mysqli_error
database connection attempt.
True or False
TRUE All text in a multiple line comment block is
ignored?
2 What is the output of the following code?
The following are examples of >, <, <=, >=,
Comparison
==________ Operators
session_start() This function starts a new session.
Which of the following is the incorrect way to
$a Variable;
declare a PHP variable?
; What is the correct way to end a PHP statement?
Select name, course_id from instructor, teaches
Select name, course_id from instructor
where instructor_ID= teaches_ID; This Query can
natural join teaches;
be replaced by which one of the following ?
2 Determine the exact output of the code:
root The default user of your phpmyadmin
The following comparison condition would return
TRUE
TRUE or FALSE : (4 <> 7)
Multiple Choice. Select the best answer
echo "Hello World";
How do you write "Hello World" in PHP
Which of the following that can be use to access
$_SESSION
session variables in PHP?
The following condition will return TRUE or FALSE
TRUE
( (4 >= 4 && 8 < 1) || (44 == 33 || 5 > 3) )
<?php...?> Multiple Choice.  Select the best answer
Multiple Choice. Select the best answerWhat data
string (a text variable) type will PHP automatically convert the following
variable to:$aVariable = "Robert";
Key Categories: offered more than 25 database
Possibility
products.
This is what happens when you set your form
$_GET
method to get
It specifies the parameter to be processed by the
index
$_FILES
mysql_num_rows() It is a function that retrieves the number of rows
mysqli_num_rows() from a query result set.
$a Variable; Multiple Choice. Select the best answer
This function searches for the first occurence of a
strchr()
string inside another string.
explode() Split a string by string.
What will be displayed in a browser when the
Hello World
following PHP code is executed:
What is the output of the following code?
$a=1;
4 ++$a;
$a*=$a;
echo $a- -;
session_destroy() This function is used to close the current session.
The PHP If Statement will only execute the code
FALSE
within it's curly braces if the if condition is FALSE?
mysql_fetch_row() It is a function that retrieves the content of one cell
mysqli_fetch_row() from a MySQL result set.
How do you start the shorthand form PHP scripting
<? … ?>
block?
The PHP If Else Statement can execute the code
FALSE
within the if and else segments at the same time?
What is the output of the following code snippet?
$str = 'asdfghyo off on off'; $replace_pairs =
Qwerghzi on off on array('a' => 'q', 's' => 'w', 'd' => 'e', 'f' => 'r', 'y' => 'z',
'o' => 'i', 'off' => 'on', 'on' => 'off'); echo strtr($str,
$replace_pairs);
It proceeds the statement causes execution of the
continue current loop iteration to end and commence at the
beginning of the next loop.
Comparison Operator This is an example of: $Ice <= $Crown;
True or False
TRUE
PHP variables are case-sensitive?
Which of the following that can be use read
$_COOKIE
cookies in PHP?
If the variable $x = 10; , what will $x equal if it is
11 incremented, that is, if I write $x++; what value will
$x contain after it has been incremented?
A group of PHP statements that performs a
Functions
specific task.
Is language construct that use to output one or
echo
more string.
Functions that are built-in into PHP to perform
Predefined Functions
some standard operations.
True or False
FALSE All text to the right of a single line comment is not
ignored?
True or False
FALSE For maximum compatibility, you should use the
shorthand form to create PHP scripts?
Practicality Key Categories: a loosely type language.
Scalar Datatypes Capable of containing a single item of information.
Multiple Choice. Select the best answer
$my-Var
Which one of these variables has an illegal name?
This function removes the white spaces and other
trim()
predefined characters from both sides of a string
TRUE True or False. Select the best answer
Multiple Choice. Select the best answerLook at the
following code and determine what will be
Hello World 1
displayed in the browser:<?php echo "Hello World
1";// echo "Hello World 2"; ?>
6 What is the output of the following code?
Numeric array, Associative array,
There are three different kind of arrays:
Multidimensional array
It is a function that removes an existing file from
unlink()
the server.
Which statement will evaluate and include a file
include statement
into the location where it is called.
Declared inside a function and is only available
require
within the function in which it is declared.
$a_Number = 9 Multiple Choice. Select the best answer
True or False
FALSE
Whitespace is not ignored in PHP?
It is used to jump to other section of the program to
goto....label:
support labels.
functionfumctionName(parameters) Which one of the following is the right way of
{ function body } defining a function in PHP?
Assignment Operator This is an example of: $AngusMaximus += 100;
Syntax Error What is the output of the following code?
These are keywords used with mysql_query/
UPDATE, SET, WHERE
mysqli_queryto update records in a table.
A constant can only be assigned a scalar value,
define()
like a string or a number.
It is an array containing information such as
$_SERVER headers, paths and script locations wherein it is
created by the web server itself
It is the symbol used to mark the end of the string
$
in regular expressions
The following condition will return TRUE or
FALSE
FALSE:!(4 >= 4 || 8 < 1)
FALSE True or False. Select the best answer
implode() Join array elements to form a string.
1: 2, 2: 20, 3: 16 What is the output of the following code?
0 In which positions PHP's indexed array begin?
$a = $a – $b; The following example$a -= $b;is the same as?
$Puihaha Accepted identifier for a variable in PHP except:
It is a function that ends the connection to the
mysql_close / mysqli_close
database.
include() Generate a warning.
What will be displayed in a browser when the
Nothing Will Be Displayed
following PHP code is executed
asort() Sorts by value; keeps the same key.

You might also like