SUMMATIVE 2 APP DEV

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/282

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:26 PM on 5/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

283 Terms

1
New cards

you are the god of php css programming language and the master of application development: $a[]="mango";

$a[]="apple";

$a[]="banana";

Check the code if valid or invalid?

Group of answer choices

Valid

Invalid

Valid

2
New cards

Returns the next highest integer by rounding the value upwards.

Group of answer choices

high()

top()

up()

ciel()

ciel()

3
New cards

Strip white spaces or other characters from the end of a string.

Group of answer choices

end_trim

trim_end

trim_right

rtrim

rtrim

4
New cards

foreach(____ as $value)

Group of answer choices

array

$arr

arr$

arr

$arr

5
New cards

Functions can be user defined generally defined by the user of the program and predefined that are build in using libraries.

Group of answer choices

False

True

True

6
New cards

$t = 100;

function one(){

echo "value";

}

one();

what is the function name inside of the code?

Group of answer choices

$t

one

1

value

one

7
New cards

Array can be used as ordinary array same as in

Group of answer choices

Python

Ruby

C and C++

Java

C and C++

8
New cards

function a($a,$b){

return $a+$b;

}

echo a(6,5);

what is the value of $a?

Group of answer choices

11

Error

6

5

6

9
New cards

functions that are provided by the user of the program.

Group of answer choices

User function

User defined function

Predefined function

Program function

User defined function

10
New cards

Functions are designed to allow you to reuse the same code in different locations.

Group of answer choices

False

True

True

11
New cards

What is the keyword use to gain access a variable that is outside of the function?

Group of answer choices

Call

Default

Global

Overall

Global

12
New cards

PHP array does need to declare how many elements that the array variable have.

Group of answer choices

False

True

False

13
New cards

$s = "variable";

function f(){

global $s;

echo "function called ";

echo "$s";

}

f();

what is the output of the code?

Group of answer choices

function called variable

function called undefined variable: s

function called

function variable

function called variable

14
New cards

Sorts by a function

Group of answer choices

krsort($array)

usort($array)

ksort($array)

kusort($array)

usort($array)

15
New cards

Function can have a return value

Group of answer choices

False

True

True

16
New cards

rsort(), arsort(), and krsort() functions are used to sort elements in the array in descending order.

Group of answer choices

False

True

True

17
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();

what is the value of the $g?

Group of answer choices

Error

5

200

4

200

18
New cards

PHP array does not need to declare how many elements that the array variable have.

Group of answer choices

False

True

True

19
New cards

it is required to create a function name for a function

Group of answer choices

True

False

True

20
New cards

You can create a function inside of a function

Group of answer choices

False

True

True

21
New cards

Functions are limited to 1 per code only

Group of answer choices

True

False

False

22
New cards

Array can be used as ordinary array same as in C and C++ arrays.

Group of answer choices

True

False

True

23
New cards

is used to aggregate a series of similar items together, arranging and dereferencing them in some specific way.

Group of answer choices

Array

Index

Function

Variable

Array

24
New cards

var_dump function is same as print_r function except it adds additional information about the data of each element.

Group of answer choices

False

True

True

25
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 0?

Group of answer choices

grape

banana

apple

orange

orange

26
New cards

Id the keyword used to declare a function

Group of answer choices

fntn

ft

function

func

function

27
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();b();

what is the output of the code?

Group of answer choices

Error

45

54

200

54

28
New cards

$t = 100;

function one(){

echo "1000";

}

one();

what is the value of the $t after execute the code?

Group of answer choices

1000

100

1

Error

100

29
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

krsort($f);

print_r($f);

What is the output of the code?

Group of answer choices

Array ( [102] => red [101] => blue [100] => yellow )

Array ( [102] => yellow [101] => blue [100] => red )

Array ( [100] => yellow [101] => blue [102] => red )

Array ( [100] => red [101] => blue [102] => yellow )

Array ( [102] => red [101] => blue [100] => yellow )

30
New cards

Function count($val){

$c = 0;

$c += $val;

echo $c;

}

count(10);

count(5);

What is the output of the code?

Group of answer choices

5

105

15

Error

105

31
New cards

You can pass values to a function and you can ask functions to return a value.

Group of answer choices

False

True

True

32
New cards

This takes an argument of any type and prints it out, which includes printing all its parts recursively.

Group of answer choices

print_a()

print_p()

print_r()

print_c()

print_r()

33
New cards

function a($a,$b){

return $a+$b;

}

echo a(5,4);

what is the name of the parameter?

Group of answer choices

B

a

$a

$b

$b

34
New cards

functions are commonly used for debugging. The point of this of these functions is to help you visualize what's going on with compound data structures like arrays.

Group of answer choices

print_p() and var_add()

print_r() and var_dump()

print_a() and var_size()

print_c() and var_info()

print_r() and var_dump()

35
New cards

Used to format a local time or date

Group of answer choices

date_time

ldate

time_date

date

date

36
New cards

Format character for numeric representation of a month, with leading zeros

Group of answer choices

l

n

m

z

m

37
New cards

What is the result of the code?

Group of answer choices

22

19

21

20

21

38
New cards

Sorts by value in reverse order; assign new number as the keys

Group of answer choices

arsort($array)

asort($array)

rsort($array)

sort($array)

rsort($array)

39
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

ksort($f);

print_r($f);

What is the output of the code?

Group of answer choices

Array ( [100] => red [101] => blue [102] => yellow )

Array ( [102] => yellow [101] => blue [100] => red )

Array ( [100] => yellow [101] => blue [102] => red )

Array ( [102] => red [101] => blue [100] => yellow )

Array ( [100] => yellow [101] => blue [102] => red )

40
New cards

is a statement used to iterate or loop through the element in an array.

Group of answer choices

foreach()

seteach()

everyeach()

everyone()

foreach()

41
New cards

is one that declared outside a function and is available to all parts of the program.

Group of answer choices

Static variables

Dynamic variables

Global variables

Local variables

Global variables

42
New cards

Each member of the array index references a corresponding value and can be a simple numerical reference to the value's position in the series, or it could have some direct correlation to the value.

Group of answer choices

True

False

True

43
New cards

Split a string by string

Group of answer choices

change

split

explode

divide

explode

44
New cards

Sorts by value in reverse order; keeps the same key

Group of answer choices

sort($array)

arsort($array)

asort($array)

rsort($array)

arsort($array)

45
New cards

function is used to print the array structure.

Group of answer choices

print_f

print_s

print_r

print_a

print_r

46
New cards

You can create your own function inside of a php code

Group of answer choices

True

False

True

47
New cards

Function count($val){

static $c = 0;

$c += $val;

echo $c;

}

Count(4);

Count(3);

What is the output of the code?

Group of answer choices

43

Error

47

7

47

48
New cards

function disp(){

function disp2(){

echo "hello";

}

}

disp();

disp2();

Group of answer choices

blank

disp

hello

error

hello

49
New cards

Sorts by value; assign new numbers as the keys

Group of answer choices

arsort($array)

rsort($array)

asort($array)

sort($array)

sort($array)

50
New cards

You use can functions in different ways.

Group of answer choices

False

True

True

51
New cards

param - is the formal parameters of the function. Parameter must follow the rule of naming dentifier.

Group of answer choices

False

True

True

52
New cards

The foreach statement is use to iterate through the element in an array.

Group of answer choices

False

True

True

53
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 2?

Group of answer choices

banana

grape

apple

orange

grape

54
New cards

Array index is also known as Array Keys.

Group of answer choices

True

False

True

55
New cards

Functions can only have 1 parameter

Group of answer choices

False

True

False

56
New cards

prints additional information about the size and type of the values it discovers

Group of answer choices

var_dump()

var_add()

var_info()

var_size()

var_dump()

57
New cards

Function count($val){

static $c = 0;

$c += $val;

echo $c;

}

count(4);

count(3);

What is the output of the code?

Group of answer choices

47

7

error

43

47

58
New cards

We use static keyword to declare a variable inside a function that will act as accumulator variable this will let the program remember the last value of the variable that was used.

Group of answer choices

False

True

True

59
New cards

function keyword is used in PHP to declare a function.

Group of answer choices

True

False

True

60
New cards

is used to retain the values calls to the same function.

Group of answer choices

Static variables

Dynamic variables

Global variables

Local variables

Static variables

61
New cards

Array index in PHP can be also called as

Group of answer choices

Array keys

Array indexes

Array Items

Array containers

Array keys

62
New cards

Array index in PHP can be also called as array storage

Group of answer choices

True

False

False

63
New cards

Local Variables is one that declared outside a function and is available to all parts of the program.

Group of answer choices

False

True

False

64
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

ab();

what is the output of the code?

Group of answer choices

error

200

54

45

error

65
New cards

sort(), asort(), and ksort() functions are used to sort elements in the array in ascending order.

Group of answer choices

True

False

True

66
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();

what is the output of the code?

Group of answer choices

4

5

200

A

5

67
New cards

Used to generate random integers.

Group of answer choices

random_int()

random()

rand()

ran()

rand()

68
New cards

What is the result of the code?

Group of answer choices

color

blank

error

red

error

69
New cards

is declared inside a function and is only available within the function in which it is declared.

Group of answer choices

Global variables

Dynamic variables

Local variables

Static variables

Local variables

70
New cards

What do you call a function inside of a function

Group of answer choices

Double function

Nested function

Function fun

Loop function

Nested function

71
New cards

is a group of PHP statements that performs a specific task. Functions are designed to allow you to reuse the same code in different locations.

Group of answer choices

Functions

Variables

Arrays

Operators

Functions

72
New cards

specify an array expression within a set of parenthesis following the foreach keyword.

Group of answer choices

False

True

True

73
New cards

$mo = array("jan","feb","mar");

echo "

";

var_dump ($mo);

echo "";

Check the code if valid or invalid?

Group of answer choices

Invalid

Valid

valid

74
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

ksort($f);

print_r($f);

What is the key of the yellow?

Group of answer choices

102

Error

100

101

100

75
New cards

functions that are built-in into PHP to perform some standard operations

Group of answer choices

User function

User defined functions

Program functions

Predefined functions

Predefined functions

76
New cards

references a corresponding value.

Group of answer choices

Array collection

Array index

Array number

Array setting

Array index

77
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

b();

what is the output of the code?

Group of answer choices

Error

200

5

4

4

78
New cards

Global Variables is declared inside a function and is only available within the function in which it is declared.

Group of answer choices

False

True

False

79
New cards

foreach($arr as ___ => $value){

//do something

}

Group of answer choices

$get

$var

$set

$key

$key

80
New cards

PHP has a built-in function to perform operations

Group of answer choices

True

False

True

81
New cards

Functions is a group of PHP statements that performs a specific task.

Group of answer choices

False

True

True

82
New cards

function disp(){

function disp2(){

echo "hello";

}

}

Disp();

disp2();

Group of answer choices

blank

hello

disp

error

error

83
New cards

You can insert CCS code inside of a function

Group of answer choices

True

False

False

84
New cards

asort() and arsort() used to sort elements by keys.

Group of answer choices

False

True

False

85
New cards

To gain access to a variable that is outside from the function we use the global keyword.

Group of answer choices

False

True

True

86
New cards

function a($a,$b){

return $a+$b;

}

echo a(5,4);

what is the output of the code?

Group of answer choices

4

9

5

Error

9

87
New cards

sort() and rsort() does not maintain its index reference for each values.

Group of answer choices

False

True

True

88
New cards

Sorts by key in reverse order

Group of answer choices

usort($array)

krsort($array)

ksort($array)

kusort($array)

krsort($array)

89
New cards

$num=array(1,2,3,4,5);

foreach(num as $val){

echo $val;

}

Check the code if valid or invalid?

Group of answer choices

Valid

Invalid

Invalid

90
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 3?

Group of answer choices

orange

grape

apple

banana

banana

91
New cards

Array is used to aggregate a series of similar items together.

Group of answer choices

True

False

True

92
New cards

Sorts by key

Group of answer choices

ksort($array)

krsort($array)

kusort($array)

usort($array)

ksort($array)

93
New cards

Function can only do something without passing values.

Group of answer choices

True

False

True

94
New cards

Array index in PHP can be also called

Group of answer choices

Array number

Array keys

Array storage

Array set

Array keys

95
New cards

asort(), ksort(), arsort(), and krsort() maintains its reference for each values.

Group of answer choices

False

True

True

96
New cards

Syntax of a function

Group of answer choices

Function name(param){}

Param_function

Param (function name){}

Function name {param}

Function name(param){}

97
New cards

foreach($arr as ______)

Group of answer choices

val

val$

$value

value$

$value

98
New cards

$num=array(1,2,3,4,5);

foreach($num as $val){

echo $val;

}

What is the output of the code?

Group of answer choices

Error

1

5

12345

12345

99
New cards

Sorts by value; keeps the same key

Group of answer choices

arsort($array)

rsort($array)

asort($array)

sort($array)

asort($array)

100
New cards

You can use only 10 for Array elements

Group of answer choices

True

False

False