Menu
Mostly asked PHP Interview Questions
What does PHP stand for?
- Hypertext Preprocessor
- Personal Home Page Preprocessor
- Private Home Page
- Preformatted Hypertext Page
- Preprocessed Hypertext Programmer
- option1 Clear All
Clear All
Which symbol is used to declare a variable in PHP?
- @
- $
- &
- #
- %
- option2 Clear All
Clear All
Which of the following are valid superglobal arrays in PHP? (Select all that apply)
Ans. - option1,option2,option3,option5
Clear All
Which of the following options can be used for single-line comments in PHP? (Select all that apply)
Ans. - option1,option2
Clear All
Which function in PHP is used to delete a file from the server?
- delete()
- unset()
- unlink()
- remove()
- erase()
- option3 Clear All
Clear All
Which of the following loop structures are supported in PHP? (Select all that apply)
Ans. - option1,option2,option4,option5
Clear All
Which built-in PHP function includes and evaluates a file, causing a fatal error if the file is not found?
Ans. - require
Clear All
Which superglobal variable holds information about headers, paths, and script locations?
- $_GLOBALS
- $_SERVER
- $_REQUEST
- $_ENV
- $_SESSION
- option2 Clear All
Clear All
Which of the following functions are used to check variable types or state in PHP? (Select all that apply)
Ans. - option1,option2,option3,option5
Clear All
What is the standard file extension for PHP scripts?
Ans. - .php
Clear All
Which function is used to send raw HTTP headers to redirect a browser to another page in PHP?
- redirect()
- header()
- url_redirect()
- location()
- route()
- option2 Clear All
Clear All
Which of the following are scalar data types in PHP? (Select all that apply)
Ans. - option1,option2,option3,option4
Clear All
What happens when a variable is evaluated inside double quotes (" ") compared to single quotes (' ') in PHP?
- Variables inside double quotes are parsed/interpolated, whereas inside single quotes they are treated as literal text.
- Variables inside single quotes are parsed/interpolated, whereas double quotes treat them as literal text.
- Both single and double quotes evaluate variables identically.
- Neither single nor double quotes allow variables inside them.
- Double quotes cause a syntax error if variables are included.
- option1 Clear All
Clear All
What operator is used for string concatenation in PHP?
Ans. - .
Clear All
Which function destroys all data registered to the current session in PHP?
- session_unset()
- session_destroy()
- session_clear()
- session_stop()
- session_delete()
- option2 Clear All
Clear All