Try to answer these 300+ PHP 5 MCQs and check your understanding of the PHP 5 subject.
Scroll down and let's begin!
A. fopen()
B. fscan()
C. scandir()
D. opendir()
E. readdir()
A. True
B. False
A. explain
B. define
C. none of the above
D. var_dump
A. fputs()
B. rename()
C. fwrite()
D. copy()
E. die()
A. PHP Extension and Application Repository
B. There is no PEAR in PHP.
C. PHP Extended Applications aRchive
A. Gambier/Islands
B. French/Polynesia
C. Europe/Zurich
A. fopen("time.txt","r");
B. open("time.txt");
C. open("time.txt","read");
D. fopen("time.txt","w+");
A. while
B. dowhile
C. foreach
D. for
A. $_ADDRESS['server_ip'];
B. $_SERVER['SERVER_ADDR'];
C. server_id();
D. server_addr();
A. TRUE
B. FALSE
A. Object Original Miscleneaous
B. Object Orientaton Mechnism
C. Object Over Masterclass
D. Object Oriented Model
E. Original Overlap Model
A.
B.
C.
D.
A. echo 'Hello World!"
B. "Hello World!"
A. isArray
B. is_array
C. array_valid
D. valid_array
A. kill_session()
B. session_destroy();
C. destroy_session()
D. reset_session()
E. session_kill()
A. Yes
B. No
A. $handle = fcopen("http://www.example.com/", "r");
B. $handle = fileopen("http://www.example.com/", "r+");
C. $handle = fopen("http://www.example.com/", "r");
D. $handle = fopen("http://www.example.com/", "r+");
E. $handle = fcopen("http://www.example.com/", "r+");
A. 1
B. 0
C. 11
D. 10
A. ===
B. !==
C. instanceof
D. ==
E. =
A. preg_* regular expression functions
B. ereg* regular expression functions
C. strtok() using regular expressions
D. strregex* regular expression functions
A. False
B. True
A. array_push()
B. array_unshift()
C. array_shift()
D. array_pop()
A. E_NOTICE
B. ERROR
C. E_ALERT
D. E_ERROR
E. E_WARNING
A. True
B. False
A. chdir()
B. closedir()
C. opendir()
D. dir()
E. rewinddir()
A. drop
B. delete
C. deletefile
D. remove
E. unlink
A. strtok()
B. strripos()
C. str_repeat()
D. strpos()
E. substr()
A. array_key_exists()
B. is_array()
C. array_search()
D. isset()
A. fgets
B. fopen
C. fappend
D. fclose
E. fwrite
A. (none of these)
B. is_object
C. TypeOject
D. isObject
A. abstract
B. incomplete
C. implements
D. protected
A. debug_backtrace()
B. trigger_error()
C. debug_print_backtrace()
D. user_error()
E. error_get_last()
A. False
B. 1
C. (none of these)
D. false
A. Fatal error
B. Mary?
C. Empty output
D. Notice
E. Warning
A. The subject
B. The recipient
C. The header
D. The message
A. urldecode( $str )
B. urlencode( $str )
C. urlcode( $str )
D. encode_url( $str )
E. encodeurl( $str )
A. PDO::stopTransaction()
B. PDO::rollbackTransaction()
C. PDO::rollBack()
D. PDO::abortTransaction()
A. date("F j, Y, g:i a");
B. date("j, n, Y");
C. date("m.d.y");
D. date('h-i-s, j-m-y, it is w Day');
E. date("D M j G:i:s T Y");
A. PDO::endTransaction()
B. PDO::commitTransaction()
C. PDO::stopTransaction()
D. PDO::closeTransaction()
E. PDO::commit()
A. b
B. 2
C. 1
D. a
E. a2
A. FALSE
B. TRUE
A. strsplit()
B. splitstr()
C. stringsplit()
D. str_split()
E. split_str()
A. True
B. False
A. require()
B. include()
C. nowarn()
D. getFile()
A. Define $_MAP superglobal
B. Set default_lib_path variable in php.ini
C. Use set_class_handler($class_handler) function
D. Define __autoload($class) magic function
E. There's no way to do it
A. protected
B. private
C. public
D. var keyword is no longer valid in PHP5
A. a = apple b = banana c = lemon d = orange
B. d = apple a = banana b = lemon c = orange
C. a = orange b = banana c = apple d = lemon
D. d = lemon a = orange b = banana c = apple
E. a = lemon b = orange c = banana d = apple
A. (both answers are correct)
B. $connection = new mysqli('localhost', 'user', 'pass', 'test');
C. $user = 'user'; $pass = 'pass'; $connection = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
A. Memory pointer
B. Classic example of PHP’s variable variables
C. Error
A. __toString()
B. __getString()
C. getString()
D. __get()