1. Question: <?php $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count($a); print_r($result); ?> What will be the output?

    A
    3

    B
    Array([0]=>3)

    C
    2

    Note: Not available
    1. Report
  2. Question: $grades = array(42, 98, 100, 100, 43, 12); sort($grades); print_r($grades); What will be the output?

    A
    Array ( [0] => 100 [1] => 100 [2] => 98 [3] => 43 [4] => 42 [5] => 12 )

    B
    Array ( [0] => 12 [1] => 42 [2] => 43 [3] => 98 [4] => 100 [5] => 100 )

    C
    Array ( [12] => 0 [42] => 1 [43] => 2 [98] => 3 [100] => 4 [100] => 5 )

    D
    Array ( [3] => 98 [4] => 100 [5] => 100 [0] => 12 [1] => 42 [2] => 43 )

    Note: Not available
    1. Report
  3. Question: $class1 = array("John" => 100, "James" => 85); $class2 = array("Micky" => 78, "John" => 45); $classScores = array_merge_recursive($class1, $class2); print_r($classScores); This returns the following:

    A
    Array ( [John] => Array ( [0] => 100 [1] => 45 ) [James] => 85 [Micky] => 78 )

    B
    Array ([1] => 45 ) [James] [John] => Array ( [0] => 100 => 85 [Micky] => 78 )

    C
    Array ( [James] => 85 [Micky] => 78 [John] => Array ( [0] => 100 [1] => 45 ) )

    D
    Array ([1] => 45 ) [James] => 85 [Micky] => 78[John] => Array ( [0] => 100 )

    Note: Not available
    1. Report
  4. Question: $abbreviations = array("AL", "AK", "AZ", "AR"); $states = array("Alabama", "Alaska", "Arizona", "Arkansas"); $stateMap = array_combine($abbreviations,$states); print_r($stateMap); This returns the following:

    A
    Array ( [AL] = Alabama [AK] = Alaska [AZ] = Arizona [AR] = Arkansas )

    B
    Array ( [0] = California [1] = Colorado [2] = Connecticut )

    C
    none

    D
    all

    Note: Not available
    1. Report
  5. Question: Which function use to check if a value exists in an array?

    A
    Array_In ()

    B
    Array_check()

    C
    Array_Fill()

    Note: Not available
    1. Report
  6. Question: Which function use tosort an array by key in reverse order

    A
    Sort()

    B
    ksort()

    C
    Krsort()

    D
    array_reverse()

    Note: Not available
    1. Report
  7. Question: How to searches the array for a given value and returns the corresponding key if successfully?

    A
    Array_in()

    B
    Search()

    C
    Array_Search()

    Note: Not available
    1. Report
  8. Question: <?php $stack = array("orange", "banana", "apple", "raspberry"); $fruit = array_pop($stack); print_r($stack); ?> What will be the output?

    A
    [0] => orange    [1] => banana    [2] => apple

    B
    [0] => orange    [1] => banana    [2] => raspberry

    C
    [0] => raspberry [1] => banana    [2] => apple

    Note: Not available
    1. Report
  9. Question: <?php $array = array("size" => "XL", "color" => "gold"); print_r(array_values($array)); ?> What will be the output?

    A
    [0] => XL    [1] => gold  [2]=>Size

    B
    [0] => XL    [1] => gold

    C
    [0]=>XL [1]=>size [1]=>gold

    Note: Not available
    1. Report
  10. Question: ksort — Sort an array with a user-defined comparison function and maintain index association

    A
    True

    B
    False

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd