PHP MCQ Questions and Answers
PHP MCQ Questions with Answers help candidates strengthen their programming fundamentals and web development logic through objective-style practice. These PHP programming questions and answers are essential for cracking technical interviews and online coding assessments conducted by top recruiters like TCS, Infosys, Cognizant, and Wipro. Each question tests key PHP concepts such as syntax, data types, arrays, functions, form handling, and error management. Practicing these programming MCQs not only enhances problem-solving speed but also builds confidence for real-time technical evaluations. Whether you are preparing for placement drives, semester exams, or web development roles, this PHP MCQ collection with explanations and solutions PDF will help you master PHP efficiently. Begin your programming test practice online now and ace your upcoming PHP interview round.
PHP MCQ
82. Full form of PHP
- PreHypertextProcessor
- HypertextPreprocessor
- Hypertext Postprocessor
- PostHypertextProcessor
84. In php Which method is used to getting browser properties?
- $_SERVER['HTTP_USER_AGENT'];
- $_SERVER['PHP_SELF']
- $_SERVER['SERVER_NAME']
- $_SERVER['HTTP_VARIENT']
85. Which of the following function is used to pick one or more random values from PHP Array?
- array_rand()
- array_random()
- Random_array()
- Rand_array()
86. <?php $x=array(1,3,2,3,7,8,9,7,3); $y=array_count_values($x); echo $y[8];
- 43
- 1
- 8
- 6
87. Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used $_SERVER['PHP_SELF'] function in your page, then what is the return value of this function ?
- phptutor/index.php
- /phptutor/index.php
- c:/apache/htdocs/phptutor/index.php
- index.php
88. Which operator is used to concatenate two strings in php?
- dot operator (.)
- plus operator (+)
89. Are there regular expressions in PHP?
- Yes - regular expressions use Perl-like conventions
- Yes - PHP supports two different types of regular expressions: POSIX-extended and Perl-Compatible Regular Expressions (PCRE).
- Yes - regular expressions use the POSIX standard
- No - PHP uses "glob" style matching only
90. In PHP, which of the following function is used to insert content of one php file into another php file before server executes it
- include[]
- #include()
- include()
- #include{}