1. Question: Which key will not be displayed from the following code block?

    <?php

    $array = array('a' => 'John',
    'b' => 'Coggeshall',
    'c' => array('d' => 'John',
    'e' => 'Smith'));

    function display($item, $key) {
    print "$key => $item\n";
    }

    array_walk_recursive($array, "display");

    ?>

    A
    d

    B
    c

    C
    b

    D
    a

    E
    They all will be displayed

    Note: Not available
    1. Report
  2. Question: What is the result of the following code snippet?

    <?php

    $array = array('a' => 'John',
    'b' => 'Coggeshall',
    'c' => array('d' => 'John',
    'e' => 'Smith'));

    function something($array) {
    extract($array);
    return $c['e'];
    }

    print something($array);
    ?>

    A
    Smith

    B
    A PHP Warning

    C

    D

    E
    Array

    Note: Not available
    1. Report
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. Question: Given the two values below, which of the following possiblities will print 10 foos20 bars?

    <?php

    $var1 = "10 foos";
    $var2 = "20 bars";

    print ???????;

    ?>

    A
    None of the above

    B
    implode("", array($var1,$var2));

    C

    D

    E
    Al

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