Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

PHP Exam Questions With Answers Graded A+

Rating
-
Sold
-
Pages
13
Grade
A+
Uploaded on
24-06-2024
Written in
2023/2024

PHP Exam Questions With Answers Graded A+ when should you use single quotes? when there are no variables in the string; if you use single quotes, PHP will not search for variables to replace, which can enhance speed. when should you use double quotes? when a variable contains any amount of variables; in general. can variable names begin with numbers? no. can variable names begin with underscores? yes. can variable names contain symbols? no. are variable names case-sensitive? yes. what should be used to have multiple quotations in one string? the escape character '': $string = "I said "Hello" to the man."; can a string with numbers be used as a number? yes. $string = "2"; can be used as $string = 2; can be used. what character must all variables begin with? the dollar sign $. is data shown in the URL if GET is used? yes; use for search engines, catalogued pages, pages that would be bookmarked. is data shown in the URL if POST is used? no; use for passwords, pages that would not be bookmarked, pages that require security. what should the action attribute's value contain? the URL to the php script that will handle the information in the form. where is data sent using POST found? predefined variable $_POST where is data sent using GET found? predefined variable $_GET what type of variable is $_SERVER $_SERVER is a predefined variable. what type of variable is $_POST? predefined variable. what type of variable is $_GET? predefined variable. will print $_POST work? why or why not? no, because you cannot use the print function on arrays

Show more Read less
Institution
Course

Content preview

PHP Exam Questions With Answers Graded
A+
when should you use single quotes?
when there are no variables in the string; if you use single quotes, PHP will not search for variables to
replace, which can enhance speed.


when should you use double quotes?
when a variable contains any amount of variables; in general.


can variable names begin with numbers?
no.


can variable names begin with underscores?
yes.


can variable names contain symbols?
no.


are variable names case-sensitive?
yes.


what should be used to have multiple quotations in one string?
the escape character '\':
$string = "I said \"Hello\" to the man.";


can a string with numbers be used as a number?
yes.
$string = "2";
can be used as
$string = 2;
can be used.


what character must all variables begin with?
the dollar sign $.


is data shown in the URL if GET is used?
yes; use for search engines, catalogued pages, pages that would be bookmarked.


is data shown in the URL if POST is used?
no; use for passwords, pages that would not be bookmarked, pages that require security.


what should the action attribute's value contain?
the URL to the php script that will handle the information in the form.

, where is data sent using POST found?
predefined variable $_POST


where is data sent using GET found?
predefined variable $_GET


what type of variable is $_SERVER
$_SERVER is a predefined variable.


what type of variable is $_POST?
predefined variable.


what type of variable is $_GET?
predefined variable.


will print $_POST work? why or why not?
no, because you cannot use the print function on arrays.


will print $_GET work? why or why not?
no, because you cannot use the print function on arrays.


will print $_SERVER work? why or why not?
no, because you cannot use the print function on arrays.


what can be used to print data in an array?
not print; print_r (human readable) can be used.


can arrays contain arrays?
yes, they commonly do contain arrays.


what is an 'index' or 'key'?
what is referred to for a value within an array.
$_POST['name'] may be equal to 'Jane Doe'
$cards[4] may be equal to 'BMW'


what will happen if $_POST['name'] is used in double quotes?
a parse error will occur, to avoid this, create shorthand variables like:
$name1 = $_POST['name1'];
$name2 = $_POST['name2'];


how do you know what to use to get a value from POST or GET?
they are the values of the name attributes of the input tags in the form.
$_POST['name'] or $_GET['name'] refers to the value of <input name="name" /> (depending on the
method of the form).

Written for

Course

Document information

Uploaded on
June 24, 2024
Number of pages
13
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.59
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LectDan Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
220
Member since
3 year
Number of followers
157
Documents
7985
Last sold
1 month ago

4.0

47 reviews

5
25
4
12
3
2
2
3
1
5

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions