1/282
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
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
Returns the next highest integer by rounding the value upwards.
Group of answer choices
high()
top()
up()
ciel()
ciel()
Strip white spaces or other characters from the end of a string.
Group of answer choices
end_trim
trim_end
trim_right
rtrim
rtrim
foreach(____ as $value)
Group of answer choices
array
$arr
arr$
arr
$arr
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
$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
Array can be used as ordinary array same as in
Group of answer choices
Python
Ruby
C and C++
Java
C and C++
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
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
Functions are designed to allow you to reuse the same code in different locations.
Group of answer choices
False
True
True
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
PHP array does need to declare how many elements that the array variable have.
Group of answer choices
False
True
False
$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
Sorts by a function
Group of answer choices
krsort($array)
usort($array)
ksort($array)
kusort($array)
usort($array)
Function can have a return value
Group of answer choices
False
True
True
rsort(), arsort(), and krsort() functions are used to sort elements in the array in descending order.
Group of answer choices
False
True
True
$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
PHP array does not need to declare how many elements that the array variable have.
Group of answer choices
False
True
True
it is required to create a function name for a function
Group of answer choices
True
False
True
You can create a function inside of a function
Group of answer choices
False
True
True
Functions are limited to 1 per code only
Group of answer choices
True
False
False
Array can be used as ordinary array same as in C and C++ arrays.
Group of answer choices
True
False
True
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
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
$fruit = array("orange","apple","grape","banana");
What is the value of index 0?
Group of answer choices
grape
banana
apple
orange
orange
Id the keyword used to declare a function
Group of answer choices
fntn
ft
function
func
function
$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
$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
$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 )
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
You can pass values to a function and you can ask functions to return a value.
Group of answer choices
False
True
True
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()
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
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()
Used to format a local time or date
Group of answer choices
date_time
ldate
time_date
date
date
Format character for numeric representation of a month, with leading zeros
Group of answer choices
l
n
m
z
m
What is the result of the code?
Group of answer choices
22
19
21
20
21
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)
$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 )
is a statement used to iterate or loop through the element in an array.
Group of answer choices
foreach()
seteach()
everyeach()
everyone()
foreach()
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
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
Split a string by string
Group of answer choices
change
split
explode
divide
explode
Sorts by value in reverse order; keeps the same key
Group of answer choices
sort($array)
arsort($array)
asort($array)
rsort($array)
arsort($array)
function is used to print the array structure.
Group of answer choices
print_f
print_s
print_r
print_a
print_r
You can create your own function inside of a php code
Group of answer choices
True
False
True
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
function disp(){
function disp2(){
echo "hello";
}
}
disp();
disp2();
Group of answer choices
blank
disp
hello
error
hello
Sorts by value; assign new numbers as the keys
Group of answer choices
arsort($array)
rsort($array)
asort($array)
sort($array)
sort($array)
You use can functions in different ways.
Group of answer choices
False
True
True
param - is the formal parameters of the function. Parameter must follow the rule of naming dentifier.
Group of answer choices
False
True
True
The foreach statement is use to iterate through the element in an array.
Group of answer choices
False
True
True
$fruit = array("orange","apple","grape","banana");
What is the value of index 2?
Group of answer choices
banana
grape
apple
orange
grape
Array index is also known as Array Keys.
Group of answer choices
True
False
True
Functions can only have 1 parameter
Group of answer choices
False
True
False
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()
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
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
function keyword is used in PHP to declare a function.
Group of answer choices
True
False
True
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
Array index in PHP can be also called as
Group of answer choices
Array keys
Array indexes
Array Items
Array containers
Array keys
Array index in PHP can be also called as array storage
Group of answer choices
True
False
False
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
$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
sort(), asort(), and ksort() functions are used to sort elements in the array in ascending order.
Group of answer choices
True
False
True
$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
Used to generate random integers.
Group of answer choices
random_int()
random()
rand()
ran()
rand()
What is the result of the code?
Group of answer choices
color
blank
error
red
error
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
What do you call a function inside of a function
Group of answer choices
Double function
Nested function
Function fun
Loop function
Nested function
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
specify an array expression within a set of parenthesis following the foreach keyword.
Group of answer choices
False
True
True
$mo = array("jan","feb","mar");
echo "
";
var_dump ($mo);
echo "";
Check the code if valid or invalid?
Group of answer choices
Invalid
Valid
valid
$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
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
references a corresponding value.
Group of answer choices
Array collection
Array index
Array number
Array setting
Array index
$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
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
foreach($arr as ___ => $value){
//do something
}
Group of answer choices
$get
$var
$set
$key
$key
PHP has a built-in function to perform operations
Group of answer choices
True
False
True
Functions is a group of PHP statements that performs a specific task.
Group of answer choices
False
True
True
function disp(){
function disp2(){
echo "hello";
}
}
Disp();
disp2();
Group of answer choices
blank
hello
disp
error
error
You can insert CCS code inside of a function
Group of answer choices
True
False
False
asort() and arsort() used to sort elements by keys.
Group of answer choices
False
True
False
To gain access to a variable that is outside from the function we use the global keyword.
Group of answer choices
False
True
True
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
sort() and rsort() does not maintain its index reference for each values.
Group of answer choices
False
True
True
Sorts by key in reverse order
Group of answer choices
usort($array)
krsort($array)
ksort($array)
kusort($array)
krsort($array)
$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
$fruit = array("orange","apple","grape","banana");
What is the value of index 3?
Group of answer choices
orange
grape
apple
banana
banana
Array is used to aggregate a series of similar items together.
Group of answer choices
True
False
True
Sorts by key
Group of answer choices
ksort($array)
krsort($array)
kusort($array)
usort($array)
ksort($array)
Function can only do something without passing values.
Group of answer choices
True
False
True
Array index in PHP can be also called
Group of answer choices
Array number
Array keys
Array storage
Array set
Array keys
asort(), ksort(), arsort(), and krsort() maintains its reference for each values.
Group of answer choices
False
True
True
Syntax of a function
Group of answer choices
Function name(param){}
Param_function
Param (function name){}
Function name {param}
Function name(param){}
foreach($arr as ______)
Group of answer choices
val
val$
$value
value$
$value
$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
Sorts by value; keeps the same key
Group of answer choices
arsort($array)
rsort($array)
asort($array)
sort($array)
asort($array)
You can use only 10 for Array elements
Group of answer choices
True
False
False