php mcqs
php mcqs
1. Hypertext Preprocessor
2. Pretext Hypertext Preprocessor
3. Personal Home Processor
4. None of the above
1. Drek Kolkevi
2. List Barely
3. Rasmus Lerdrof
4. None of the above
1. ! (Exclamation)
2. $ (Dollar)
3. & (Ampersand)
4. # (Hash)
1. .php
2. .hphp
3. .xml
4. .html
Description: Generally, a PHP file contains HTML tags and some PHP
scripting code. It is very easy to create a simple PHP example. The programs
in php are saved with the .php extension.
1. Extern
2. Local
3. Static
4. Global
Description:
The scope of a variable is defined as its range in the program under which it
can be accessed. PHP has three types of variable scopes:
o Local variable
o Global variable
o Static variable
1. & …… &
2. // ……
3. /* …… */
4. Both (b) and (c)
Description:
PHP comments can be used to describe any line of code so that other
developers can understand the code easily. PHP supports single-line and
multi-line comments. There are two ways to use single-line comments in PHP.
1. echo
2. write
3. print
4. Both (a) and (c)
Description: In PHP, both echo and print are language constructs. Both echo
and print statements can be used with or without parentheses. We can use
these statements to output variables or strings. The echo is a statement,
which is used to display the output. The print is a statement used as an
alternative to echo at many times to display the output.
8) Which of the following is the use of strlen() function in PHP?
1. + (plus)
2. * (Asterisk)
3. . (dot)
4. append()
1. Inbuilt constants
2. User-defined constants
3. Magic constants
4. Default constants