PHP Programming Solved MCQ 2020-21
BCA 6 Semester | HNBGU
-
PHP stands for:
- Hypertext Preprocessor
- Pretext Hypertext Preprocessor
- Personal Home Processor
- None of the above
-
Who is known as the father of PHP
- Drek Kolkevi
- List Barely
- Rasmus Lerdrof
- None of the above
-
Variable name in PHP starts with:
- ! (Exclamation)
- $ (Dollar)
- & (Ampersand)
- # (Hash)
-
Which of the following is the default file extension of PHP?
- php
- hphp
- xml
- html
-
Which of the following is not a variable scope in PHP?
- Extern
- Local
- Static
- Global
-
Which of the following is correct to add a comment in php?
- &.....&
- //.....
- /*.....*/
- Both (b) and (c)
-
Which of the following is used to display the output in PHP?
- echo
- write
- print
- Both (a) and (c)
-
Which of the following is the use of strlen() function in PHP?
- The strlen() function returns the type of string
- The strlen() function returns the length of string
- The strlen() function returns the value of string
- The strlen() function returns the value and type of string
-
Which of the following is used for concatenation in PHP?
- + (plus)
- * (asterisk)
- . (dot)
- append()
-
Which of the following starts with __ (double underscore) in php?
- Inbuilt constant
- User defined constants
- Magic constants
- Default constants
-
Which of the following is the use of strops() function in PHP?
- The strops() function is used to search for the spaces in a string
- The strops() function is used to search for a number in a string
- The strops() function is used to search for a character/text in a string
- The strops() function is used to search for a capitalize character in a string
-
What will be the output of the following program
< ?php
$var = “Hello World”;
echo strrev(“$var1“);
?>
- dlroWolleH
- olleHdlreW
- Hello DlroW
- None of the above
-
Which of the following is the correct way to create a function in PHP?
- Create myFunction()
- New_function myFunction()
- function myFunction()
- None of the above
-
Which of the following functions converts a string to all uppercase?
- upper()
- uppercase()
- struppercase()
- strtoupper()
-
Which of the following is the correct way of defining a variable in PHP?
- $variable name = value;
- $variable_name = value;
- $variable_name = value
- $variable name as value;
-
Which of the following is the correct use of the strcmp() function in PHP?
- The strcmp() function is used to compare the strings excluding case.
- The strcmp() function is used to compare the uppercase strings.
- The strcmp() function is used to compare the lowercase strings
- The strcmp() function is used to compare the strings including case
-
Which of the following functions is used to compute the difference between two arrays in PHP?
- diff_array
- array_diff
- arrays_diff
- diff_arrays
-
What is the use of isset() function in PHP?
- The isset() function is used to check whether variable is set or not
- The isset() function is used to check whether variable is free or not
- The isset() function is used to check whether variable is string or not
- None of the above
-
What is the use of sprint() function in PHP?
- The sprint() function is used to print the output of program
- The sprint() function is used to send the output to variable
- Both (a) and (b)
- None of the above
-
Which PHP function is used to find the position of the last occurrence of a substring inside another string?
- strops()
- strrpos()
- strtr()
- None of the above
-
Which of the following functions displays the information about PHP and its configuration?
- php_info()
- phpinfo()
- info()
- DefaNone of the aboveult
-
The function in PHP that can be used to concatenate array elements to form a single delimited string is :
- implode()
- concat()
- explode()
- concatenate()
-
Which of the following functions is used to set cookie in PHP?
- createcookie()
- makecookie()
- setcookie()
- None of the above
-
Which of the following funcitons is used to get the ASCII value of a character in PHP?
- val()
- asc()
- asci()
- chr()
-
Which of the following functions is used to unset a variable in PHP?
- delete()
- unset()
- unlink()
- None of the above
-
Which of the following functions is used to sort an array in descending order?
- sort()
- asort()
- dsort()
- rsort()
-
Which of the following is the code editors in PHP?
- Notepad++
- Notepad
- Adobe Dreamweaver
- All of the above
-
Which of the following is used to end a statement in PHP?
- . (dot)
- ; (semicolon)
- ! (exclamation)
- / (slash)
-
Which of the following functions in PHP can be used to test the type of any variable?
- showtype()
- gettype()
- settype()
- None of the above
-
string values in PHP must be enclosed within:
- Double quotes
- single quotes
- Both (a) and (b)
- None of the above
-
Which of the following variable names is invalid?
- $newVar
- $new_Var
- $new-var
- All of the above
-
Which of the following is the correct way to create an array in PHP?
- $season = array, [“summer”,”winter”,”spring”,”autumn”];
- $season = array (“summer”,”winter”,”spring”,”autumn”);
- $season = “summer”,”winter”,”spring”,”autumn”;
- All of the above
-
Which of the following is a built-in function in PHP that adds a value to the end of an array?
- array_push()
- inend_array()
- into_array()
- None of the above
-
Which of the following functions in PHP returns a text in title case from a variable?
- toUpper($var)
- ucwords($var)
- ucword($var)
- All of the above
-
Which of the following is the correct way to print “Hello World” in PHP?
- “Hello World”;
- write(“Hello World”);
- echo “Hello World”;
- None of the above
No comments:
Post a Comment