App Dev (PHP-LAB) Flashcards
$t = 100;
function one(){
echo “value”;
}
one();
what is the function name inside of the code?
value
Id the keyword used to declare a function
function
Sorts by a function
usort($array)
Array can be used as ordinary array same as in
Group of answer choices
Java
Ruby
C and C++
Python
Python
$a[]=”mango”;
$a[]=”apple”;
$a[]=”banana”;
Check the code if valid or invalid?
INVALID
You can create a function inside of a function (T/F)
TRUE
$mo = array(“jan”,”feb”,”mar”);
echo “<pre>”;
print_r ($mo);
echo “</pre>”;
Check the code if valid or invalid?
INVALID
Syntax for foreach
foreach($arr as $value){}
param – is the formal parameters of the function. Parameter must follow the rule of naming dentifier. (T/F)
TRUE
You can insert CCS code inside of a function (T/F)
FALSE
PHP array does not need to declare how many elements that the array variable have. (T/F)
TRUE
specify an array expression within a set of parenthesis following the foreach keyword. (T/F)
TRUE
functions that are built-in into PHP to perform some standard operations
Predefined functions
function a($a,$b){
return $a+$b;
}
echo a(6,5);
what is the value of $a?
11
$f = array(
‘102’ => “red”,
‘101’ => “blue”,
‘100’ => “yellow”);
ksort($f);
print_r($f);
What is the output of the code?
Array ( [100] => yellow [101] => blue [102] => red )