Quiz: Professional Test For PHP Web Developers!

15 Questions | Total Attempts: 3842

SettingsSettingsSettings
Please wait...
Quiz: Professional Test For PHP Web Developers!

What does a PHP web developer do? PHP is a general-purpose programming language that was originally designed for web development. PHP is being used by more developers, especially in the world of freelancers. It is used mostly because of the cost matter. PHP developers create programs, applications, and web sites, and PHP is known for its web development and business application. Take this impressive quiz to see what you know about web developers.


Questions and Answers
  • 1. 
    What will be printed?if ('2' == '02') { echo 'true';} else { echo 'false';}
    • A. 

      True

    • B. 

      False

  • 2. 
    • A. 

      !=

    • B. 

      >=

    • C. 

    • D. 

    • E. 

      ===

  • 3. 
    What will be printed?$a = array( null => 'a', true => 'b', false => 'c', 0 => 'd', 1 => 'e', '' => 'f');echo count($a), "\n";
    • A. 

      2

    • B. 

      3

    • C. 

      4

    • D. 

      5

    • E. 

      6

  • 4. 
    What gets printed?class MyException extends Exception {}try { throw new MyException('Oops!');} catch (Exception $e) { echo "Caught Exception\n";} catch (MyException $e) { echo "Caught MyException\n";}
    • A. 

      Caught Exception

    • B. 

      Caught MyException

  • 5. 
    What will be printed?$a = array();if ($a[1]) null;echo count($a), "\n";
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      This code wont compile

  • 6. 
    What gets printed?$str = 'a\\b\n'; echo $str;
    • A. 

      Ab(newline)

    • B. 

      A\b(newline)

    • C. 

      A\b\n

    • D. 

      A\\b(newline)

    • E. 

      A\\b\n

  • 7. 
    What is a correct way of defining constants in PHP
    • A. 

      Constant $var

    • B. 

      Const $var

    • C. 

      Constant ($var)

    • D. 

      Define("Constant");

  • 8. 
    Which function will you use to convert an HTML page into a format that can be saved in database conveniently
    • A. 

      Stripslashes()

    • B. 

      Htmlentities()

    • C. 

      Htmlspecialchars()

  • 9. 
    Which of the following functions will be used to create a CURL sessions
    • A. 

      Curl_exec()

    • B. 

      Curl_opt()

    • C. 

      Curl_init()

    • D. 

      Curl_setopt()

  • 10. 
    • A. 

      GET will not show variables in URL of address bar of browser

    • B. 

      POST variables can not be accessed by $_REQUEST[] Server side array

    • C. 

      Using POST, you can hide form data from being viewed on address bar or browser

  • 11. 
    Which of following statements will be used to fetch SINGLE record  from a MySql resultset
    • A. 

      Mysql_connect

    • B. 

      Mysql_query

    • C. 

      Mysql_fetch_array

    • D. 

      Mysql_fetch_row

  • 12. 
    What is correct syntax of connecting to a MySql database
    • A. 

      Mysql_connect($username,$password)

    • B. 

      Connect_mysql($username,$password)

    • C. 

      Mysql_connect("localhost",$username,$password)

  • 13. 
    Which of the following functions MUST be called AFTER using mysql_connect() function
    • A. 

      Mysql_query

    • B. 

      Mysql_fetch_array

    • C. 

      Mysql_select_db

    • D. 

      Mysql_fetch_row

  • 14. 
    What gets printed?<?php$RESULT = 11 + 011 + 0x11;echo "$RESULT";?>
    • A. 

      11

    • B. 

      22

    • C. 

      33

    • D. 

      37

    • E. 

      39

  • 15. 
    What will be the value of $var below?$var = true ? '1' : false ? '2' : '3';
    • A. 

      1

    • B. 

      2

    • C. 

      3