Introduction to PHP Flashcards

1
Q

Acronym for PHP

A

PHP: Hypertext Preprocessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  • A server-side programming language – it runs on a web server.
  • A widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
A

PHP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2 URLS for viewing in the address bar of your web browser:

A
  1. localhost/folder_name
  2. 127.0.0.1/folder_name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Without specifying the file to open _________ is the default webpage that will be displayed.

A

index.php

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Three different pairs of opening and closing tags

A
  1. Default syntax
  2. Short open tags
  3. Omit the PHP closing tag at the end of the file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Short style tags are only available when enabled in _ configuration on file servers.

A

php.ini

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or False

In PHP the user defined functions, classes, core language keywords (e.g. if, else, while, echo etc.) are case insensitive.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False

In terms of VARIABLES, PHP is case-insensitive

A

False

In terms of VARIABLES it is case-sensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A _ in PHP code is a line that is not executed as a part of the program. Its only purpose is to be read by someone who is looking at the code.

A

comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

PHP variable names must begin with a _ , and cannot contain spaces.

A

dollar ($) sign

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False

Variables in PHP don’t need data type.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

are used to perform different actions based on different conditions

A

Conditional statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

executes some code if one condition is true.

A

if statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

executes some code if a condition is true and another code if that condition is false.

A

if…else statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

executes different codes for more than two conditions.

A

if…else if…else statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

used to perform different actions based on different conditions.

A

switch statement

17
Q

Loops through a block of code a specified number of times.

18
Q

Loops through a block of code as long as the specified condition is true.

A

while loop

19
Q

Loops through a block of code once, and then repeats the loop as long as the specified condition is true. This loop will always execute the block of code once.

A

do…while loop

20
Q

Loops through a block of code for each element in an array.

A

foreach loop