1. Question: What should go in the missing line ?????below to produce the output shown? <?php $array_one = array(1,2,3,4,5); $array_two = array('A', 'B', 'C', 'D', 'E'); ??????? print_r($array_three); ?> Result: Array ( [5] => A [4] => B [3] => C [2] => D [1] => E )

    A
    $array_three = array_merge(array_reverse($array_one), $array_two);

    B
    $array_three = array_combine($array_one, $array_two);

    C
    $array_three = array_combine(array_reverse($array_one), $array_two);

    D
    <label for="65_4">$array_three = array_merge($array_one, $array_two);</label>

    E
    $array_three = array_reverse($array_one) + $array_two;

    Note: Not available
    1. Report
  2. Question: Which of the following functions are used with the internal array pointer to accomplish an action?

    A
    key

    B
    forward

    C
    prev

    D
    current

    E
    next

    Note: Not available
    1. Report
  3. Question: Given the following array: $array = array(1,1,2,3,4,4,5,6,6,6,6,3,2,2,2); The fastest way to determine the total number a particular value appears in the array is to use which function?

    A
    array_total_values

    B
    array_count_values

    C
    A foreach loop

    D
    count

    E
    a for loop

    Note: Not available
    1. Report
  4. Question: The ____ construct is particularly useful to assign your own variable names to values within an array.

    A

    B
    current

    C

    D

    E
    list

    Note: Not available
    1. Report
  5. Question: The following code snippet displays what for the resultant array? <?php $a = array(1 => 0, 3 => 2, 4 => 6); $b = array(3 => 1, 4 => 3, 6 => 4); print_r(array_intersect($a, $b)); ?>

    A
    1 => 0

    B
    1 => 3, 3 => 1, 4 => 3

    C
    3 => 1, 3=> 2, 4 => 3, 4=> 6

    D
    1 => 0, 3 => 2, 4 => 6

    E
    An empty Array

    Note: Not available
    1. Report
  6. Question: Which of the following are not valid ways to embed a variable into a string?

    A
    $a = "Value: $value->getValue()";

    B
    $a = "Value: {$value}";

    C
    $a = 'Value: $value';

    D
    $a = "Value: $value";

    E
    $a = "Value: {$value['val']}";

    Note: Not available
    1. Report
  7. Question: What variable reference would go in the spots indcated by ????? in the code segment below?
    <?php
    
    $msg = "The Quick Brown Foxed Jumped Over the Lazy Dog";
    
    $state = true;
    $retval = "";
    for($i = 0; (isset(??????)); $i++) {
    	if($state) {
    		$retval .= strtolower(?????);
    	} else {
    		$retval .= strtoupper(?????);
    	}
    	
    	$state = !$state;
    }
    
    print $retval;
    
    ?>

    A
    $msg{$i}

    B
    ord($msg);

    C
    chr($msg);

    D
    substr($msg, $i, 2);

    E
    None

    Note: Not available
    1. Report
  8. Question: What is the output?
    <?php 
    $array = array(10,20, 30, 40); 
    print_r(array_pad($array,-8,0)); 
    ?>

    A
    [0]=> 0, [1]=> 0, [2]=> 0, [3]=> 0, [4]=> 10, [5]=> 20, [6]=> 30, [7]=> 40

    B
    [0]=> 10, [1]=> 20, [2]=> 30, [3]=> 40, [4]=> 0, [5]=> 0, [6]=> 0, [7]=> 0

    C
    [0]=> 10, [1]=> 20, [2]=> 0, [3]=> 0, [4]=> 0, [5]=> 0, [6]=> 30, [7]=> 40

    D
    None

    Note: Not available
    1. Report
  9. Question: What is the output for the following code?
    <?php 
    $array = array(10,20, 30, 40);
    array_shift($array); 
    print_r($array); 
    ?>

    A
    [0]=> 20, [1]=> 30, [2]=> 40

    B
    [0]=> 10, [1]=> 20, [2]=> 30

    C
    [0]=> 30, [1]=> 40, [2]=> 10

    D
    [0]=> 40, [1]=> 30, [2]=> 20

    Note: Not available
    1. Report
  10. Question: What is the output?
    <?php 
    $array = array("x"=>"10","y"=>20, "z"=>30); 
    $values=array_flip($array); 
    print_r($values); 
    ?>

    A
    Array ( [x] => 10 [y] => 20 [z] => 30 )

    B
    Array ( [10] => x [20] => y [30] => z )

    C
    Array ( [0] => x [1] => y [2] => z )

    D
    Array ( [x] => 30 [y] => 20 [z] => 10 )

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