Online Test for PHP

  1. A PHP scripting block always starts with
    < ?php ...... ?>
    <@ ....... />
    <% .... %>
    { ..... }

  1. Find Error/Output in follwing code:
  2.                                 
    <?php
    
    $email  
    'sumit@gmail.com';
    $user strstr($email'@'true);
    echo 
    $user;
    ?>
    sumit
    @gmail.com
    gmail.com
    sumit@


  1. _______ function is used to sort an array in ascending order by value while preserving key associations.
    ksort()
    asort()
    krsort()
    usort()

  1. PHP is an open source software
    True
    False

  1. What will range('a', 'z') return?
    Find difference between 'a' to 'z'
    An alphabetically ordered array of letters from 'a' to 'z'
    Will only apply on integer value
    None of the above

  1. Which is a valid character for starting a PHP function name?
    Dollar Sign ($)
    Underscore (_)
    Percent (%)
    All of the above


  1. list in PHP is ?
    Language construct
    Keyword
    A & C Both
    None of the above

  1. Interface constant can be override in class implementing the interface.
    True
    False

  1. If cookie expiration time is not set explicitly, what happens to it?
    It expires right away
    It never expires
    It is not set
    It expires at the end of the user's browser session

  1. What function creates a cookie?
    create_cookie()
    set_cookie()
    setcookie()
    None of the above

Post Your Question
Social Sharing
Search