Quiz Flashcards

1
Q

define function in PHP

A

function functionName(parameters) { function body}

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

php variables start with what symbol

A

$

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

what does a semicolon signify at the end of statement?

A

end of a php statement or instruction

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

valid header for a function in PHP

A

function testFunc()

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

valid PHP var name

A

$myVar

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

join strings in PHP

A

$myVar3 = “aaaa” . “bbb”;

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

use the include command

A

require “example.php”;

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

data type of $aVariable = “Robert”;

A

string (text variable)

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

standard form php scripting block

A

<?php … ?>

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

extension of file php code

A

.php

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

how to connect to mysql database using php’s PDO class?

A

$dbCon = new PDO(“mysql:host=”.$host.”;dbname=”.$dbName, $username, $password);

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

correct output of:

<?php

if (true) {
echo “hello”;
} else {
echo “hi”;
}

?>

A

hello

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