click below
click below
Normal Size Small Size show me how
CCS0043 - FA3
Module 3
| Question | Answer |
|---|---|
| var_dump function is same as print_r function except it adds additional information about the data of each element. Group of answer choices True False | 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_r() print_c() print_p() | print_r() |
| Function can have a return value Group of answer choices True False | True |
| What do you call a function inside of a function Group of answer choices Function fun Loop function Nested function Double function | Nested function |
| $fruit = array(“orange”,”apple”,”grape”,”banana”); What is the value of index 2? Group of answer choices banana grape orange apple | grape |
| Array index in PHP can be also called Group of answer choices Array set Array keys Array number Array storage | Array keys |
| rsort(), arsort(), and krsort() functions are used to sort elements in the array in descending order. Group of answer choices False True | True |
| foreach($arr as ______) Group of answer choices $value val$ value$ val | $value |
| sort(), asort(), and ksort() functions are used to sort elements in the array in ascending order. Group of answer choices True False | True |
| $fruit = array(“orange”,”apple”,”grape”,”banana”); What is the value of index 0? Group of answer choices orange grape apple banana | orange |
| is a statement used to iterate or loop through the element in an array. Group of answer choices everyone() seteach() foreach() everyeach() | foreach() |
| Array index in PHP can be also called as array storage Group of answer choices False True | False |
| You can create your own function inside of a php code Group of answer choices False True | True |
| Syntax of a function Group of answer choices Param (function name){} Function name(param){} Function name {param} Param_function | Function name(param){} |
| Array can be used as ordinary array same as in C and C++ arrays. Group of answer choices True False | True |
| Array can be used as ordinary array same as in Group of answer choices Ruby Python C and C++ Java | C and C++ |
| $g = 200; function a(){echo “5”;} function b(){echo “4”;} a();b(); what is the output of the code? Group of answer choices 45 200 Error 54 | 54 |
| $g = 200; function a(){echo “5”;} function b(){echo “4”;} a(); what is the value of the $g? Group of answer choices 4 200 5 Error | 200 |
| 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 True False | True |
| function disp(){ function disp2(){ echo “hello”; } } disp(); disp2(); Group of answer choices blank error disp hello | hello |
| asort(), ksort(), arsort(), and krsort() maintains its reference for each values. Group of answer choices False True | True |
| functions that are built-in into PHP to perform some standard operations Group of answer choices User function Predefined functions User defined functions Program functions | Predefined functions |
| references a corresponding value. Group of answer choices Array number Array setting Array index Array collection | Array index |
| function disp(){ function disp2(){ echo “hello”; } } Disp(); disp2(); Group of answer choices blank error disp hello | hello |
| is declared inside a function and is only available within the function in which it is declared. Group of answer choices Global variables Local variables Static variables Dynamic variables | Local variables |
| function disp(){ function disp2(){ echo “hello”; } } disp2(); Group of answer choices blank error hello disp | error |
| function keyword is used in PHP to declare a function. Group of answer choices False True | True |
| sort() and rsort() does not maintain its index reference for each values. Group of answer choices True False | True |
| To gain access to a variable that is outside from the function we use the global keyword. Group of answer choices False True | True |
| You can use only 10 for Array elements Group of answer choices False True | False |
| Syntax for foreach Group of answer choices foreach{}($arr as $value) foreach($value){} foreach($arr as $value){} foreach($arr){} | foreach($arr as $value){} |
| $g = 200; function a(){echo “5”;} function b(){echo “4”;} b(); what is the output of the code? Group of answer choices Error 4 200 5 | 4 |
| prints additional information about the size and type of the values it discovers Group of answer choices var_add() var_dump() var_info() var_size() | var_dump() |
| You can create a function inside of a function Group of answer choices True False | True |
| ksort() and krsort() used to sort elements by values. Group of answer choices True False | False |
| function is used to print the array structure. Group of answer choices print_f print_s print_r print_a | print_r |
| is used to retain the values calls to the same function. Group of answer choices Global variables Local variables Dynamic variables Static variables | Static variables |
| Sorts by key Group of answer choices kusort($array) ksort($array) krsort($array) usort($array) | ksort($array) |
| $a[]=”mango”; $a[]=”apple”; $a[]=”banana”; Check the code if valid or invalid? Group of answer choices Invalid Valid | Valid |
| $mo = array(“jan”,”feb”,”mar”); echo “<pre>”; print_r ($mo); echo “</pre>”; Check the code if valid or invalid? Group of answer choices Invalid Valid | Valid |
| $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 12345 5 1 | 12345 |
| Sorts by value; keeps the same key Group of answer choices rsort($array) arsort($array) asort($array) sort($array) | asort($array) |
| function a($a,$b){ return $a+$b; } echo a(5,4); what is the output of the code? Group of answer choices 5 Error 4 9 | 9 |
| PHP has a built-in function to perform operations Group of answer choices True False | True |
| You can insert CCS code inside of a function Group of answer choices True False | True |
| function a($a,$b){ return $a+$b; } echo a(5,4); what is the name of the parameter? Group of answer choices $a B a $b | a |
| A function that is declared inside a function is said to be hidden. Group of answer choices False True | True |
| is one that declared outside a function and is available to all parts of the program. Group of answer choices Dynamic variables Global variables Local variables Static variables | Global variables |
| Id the keyword used to declare a function Group of answer choices ft fntn function func | function |
| Functions can only have 1 parameter Group of answer choices True False | False |
| $g = 200; function a(){echo “5”;} function b(){echo “4”;} ab(); what is the output of the code? Group of answer choices 45 54 200 error | error |
| Array index is also known as Array Keys. Group of answer choices True False | True |
| Sorts by value; assign new numbers as the keys Group of answer choices sort($array) asort($array) rsort($array) arsort($array) | sort($array) |
| 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_c() and | print_r() and var_dump() |
| param – is the formal parameters of the function. Parameter must follow the rule of naming dentifier. Group of answer choices False True | True |
| specify an array expression within a set of parenthesis following the foreach keyword. Group of answer choices True False | True |
| function a($a,$b){ return $a+$b; } echo a(6,5); what is the value of $a? Group of answer choices 5 6 Error 11 | 6 |
| Function can only do something without passing values. 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 7 Error 47 | Error |
| 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 |
| Global Variables is declared inside a function and is only available within the function in which it is declared. Group of answer choices True False | False |
| Functions are designed to allow you to reuse the same code in different locations. Group of answer choices False True | True |
| Sorts by value in reverse order; keeps the same key Group of answer choices arsort($array) rsort($array) asort($array) sort($array) | arsort($array) |
| is used to aggregate a series of similar items together, arranging and dereferencing them in some specific way. Group of answer choices Variable Array Function Index | Array |
| it is required to create a function name for a function Group of answer choices False True | True |
| Using foreach statement you can display both the keys and value of each element in the array. Group of answer choices True False | True |
| Function can be put anywhere of the code Group of answer choices False True | False |
| foreach(____ as $value) Group of answer choices arr array $arr arr$ | $arr |
| $fruit = array(“orange”,”apple”,”grape”,”banana”); What is the value of index 1? Group of answer choices apple banana grape orange | apple |
| Functions are limited to 1 per code only Group of answer choices False True | False |
| Sorts by key in reverse order Group of answer choices kusort($array) usort($array) krsort($array) ksort($array) | krsort($array) |
| Sorts by value in reverse order; assign new number as the keys Group of answer choices sort($array) asort($array) arsort($array) rsort($array) | rsort($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 |
| $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 ( [102] => red [101] => blue [100] => yellow ) Array ( [100] => red [101] => blue [102] => yell | Array ( [100] => yellow [101] => blue [102] => red ) |
| The foreach statement is use to iterate through the element in an array. Group of answer choices False True | True |
| You can pass values to a function and you can ask functions to return a value. Group of answer choices True False | True |
| $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] => | Array ( [102] => red [101] => blue [100] => yellow ) |
| $f = array( '102' => "red", '101' => "blue", '100' => "yellow"); ksort($f); print_r($f); What is the key of the yellow? Group of answer choices 101 Error 102 100 | 100 |
| PHP array does need to declare how many elements that the array variable have. Group of answer choices False True | False |
| PHP array does not need to declare how many elements that the array variable have. Group of answer choices True False | True |
| 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 |
| functions that are provided by the user of the program. Group of answer choices User function Program function Predefined function User defined function | User defined function |
| $g = 200; function a(){echo “5”;} function b(){echo “4”;} a(); what is the output of the code? Group of answer choices A 4 5 200 | 5 |
| asort() and arsort() used to sort elements by keys. Group of answer choices True False | False |
| Array is used to aggregate a series of similar items together. 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 1 one value | one |