1. Question: print 'This string will $print exactly as it's \n declared.'; This produces the following:

    A
    This string will $print exactly as it's \n declared.

    B
    This string will $print exactly as it's declared.

    C
    This string will $print exactly as it's declared.

    D
    This string will $print exactly as it's \n declared.

    Note: Not available
    1. Report
  2. Question: <?php
    $primes = array(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47);
    for($count = 1; $count++; $count < 1000) {
      $randomNumber = rand(1,50);
    
      if (in_array($randomNumber,$primes)){
        break;
      }else {
        printf("Non-prime number found: %d", $randomNumber);
      }
    }
    ?>
    Sample output follows:

    A
    Non-prime number found: 48 Non-prime number found: 42 Prime number found: 17

    B
    Non-prime number found: 48 Non-prime number found: 42 Prime number found: 00

    C
    48 17

    D
    Non-prime number found Non-prime number found Prime number found

    Note: Not available
    1. Report
  3. Question: What is the output for the following code?
    <?php
    $usernames = array("Grace","Doris","Gary","Nate","missing","Tom");
    for ($x=0; $x < count($usernames); $x++) {
    if ($usernames[$x] == "missing") continue;
    printf("Staff member: %s <br />", $usernames[$x]);
    }
    ?>

    A
    Staff member: Grace Staff member: Doris Staff member: Gary Staff member: Nate Staff member: Tom

    B
    Staff member: Gary Staff member: Nate Staff member: Tom Staff member: Grace Staff member: Doris

    C
    Grace Doris Gary Nate missing Tom

    D
    none

    Note: Not available
    1. Report
  4. Question: 
    function calculate($price, $price2="", $price3="")
    {
      echo $price + $price2 + $price3;
    }
    You can then call calculate(), passing along just $price and $price3, like so: calculate(10, "", 3); This returns the following value:

    A
    13

    B
    10, "", 3

    C
    10,00, 3

    D
    10null3

    Note: Not available
    1. Report
  5. Question: Which of the following is not valid syntax for creating a new array key?

    A
    $a[] = "value";

    B

    C

    D

    E

    Note: Not available
    1. Report
  6. Question: Which symbol is used for reference assignment?

    A
    $

    B
    &

    C
    @

    D
    ;

    Note: Not available
    1. Report
  7. Question: Write the output of echo ("35 hello 55"+65); statement?

    A
    155

    B
    120

    C
    100

    D
    90

    Note: Not available
    1. Report
  8. Question: The following piece of script will output: [code] <?php $email=admin@psexam.com; $new=strstr($email,’@’); Print $new; ?> [/php]

    A
    admin

    B
    admin@psexam

    C
    @psexam.com

    D
    psexam.com

    Note: Not available
    1. Report
  9. Question: Which type of function is called by itself?

    A
    Nesting Function

    B
    Recursive Function

    C
    Variable Function

    D
    All

    Note: Not available
    1. Report
  10. Question: Given:
    <?php
    $checkState=4;
    for($count=1;$count<10;$count=$checkState+$count){
    if($checkState==4){
    echo "The value of count is :$count";
    break;
    }else{
    echo "The value of checkState is:$checkState";
    }
    }
    ?>
    Which of the followings are correct?

    A
    The value of count is :1

    B
    The value of count is :5

    C
    The value of count is :9

    D
    The” The value of chechState is:4” will be printed three times

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