Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

php programming language MCQ : Arrays-Converting between arrays and variables Link4

php programming language MCQ : Arrays-Converting between arrays and variables Link4

Arrays MCQ

       Are you worried about the answers to PHP programming-Arrays-Identifying elements of an array, Storing data in arrays, Multidimensional arrays, Extracting multiple values, Converting between arrays and variables, Traversing arrays, Sorting questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Arrays MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. For getting rid of an assigned variable in an array which function is used?

A. delete_array ( )                                                              B. reset_array
C. reset ( )                                                       D. unset ( )

Q.2. Foreach ( ), current ( ), next ( ), reset ( ), each ( ) and array_walk ( ) all these functions are example of---------

A. Searching arrays                                                              B. Creating arrays
C. Iteration of arrays                                                       D. Deleting of arrays

Q.3. A function that takes two integers as arguments and returns an array filled with all integers between them, is known as-------.

A. Range ( ) function B. Value ( ) function
C. Limit ( ) function
D. None of the above

Q.4. Next ( ) function returns value after the -----.

A. pointer is reversed
B. pointer is moved
C. array is empty
D. None of the above

Q.5. $multi_array [1] [2] [3] [4] = "I am working on PHP"; will create ------.

A. One dimensional array
B. 5 dimensional array
C. 4 dimensional array
D. None of the above

Q.6. In vector arrays, the elements must have -----------.

A. Same size
B. Same type
C. Different size
D. Different type

Q.7. Other than index values an array can be retrieved by a function that is called as -------.

A. Retrieve ( ) function
B. Array_retrive ( ) function
C. list ( ) function
D. Array_call ( ) function

Q.8. Three ways to create an array is Direct assignment, array ( ) construct and ---------.

A. Functions returning arrays
B. Functions creating arrays
C. Keys creating arrays
D. None of the above

Q.9. What will be the output of the following PHP code?

 <?php \\
\$a=array("A","Cat","Dog","A","Dog"); \\
\$b=array("A","A","Cat","A","Tiger"); \\
\$c=array\_combine(\$a,\$b);\\
print\_r(array\_count\_values(\$c)); \\
?>

A. Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 )
B. Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
C. Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
D. Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 )

Q.10. What will be the output of the following PHP code?

 <?php \\
\$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow"); \\
\$a2 = array("e" => "red", "f" => "green", "g" => "blue", "h" => "orange"); \\
\$a3 = array("i" => "orange"); \\
\$a4 = array\_combine(\$a2, \$a3); \\ 
\$result = array\_diff(\$a4, \$a2);  \\
print\_r(\$result); \\
?>

A. Array ( [i] => orange )                                                                  B. Array ( [d] => yellow )
C. Array ( [h] => orange )                                                    D. Array ( [d] => yellow [h] => orange )

php programming language MCQ : Arrays -Sorting Link3

Php programming language MCQ : Arrays: Link3

Arrays MCQ

       Are you worried about the answers to PHP programming-Arrays-Identifying elements of an array, Storing data in arrays, Multidimensional arrays, Extracting multiple values, Converting between arrays and variables, Traversing arrays, Sorting questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Arrays MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. PHP arrays are also called as--------

A. Vector arrays                                                              B. Perl arrays
C. Hashesfunction                                                       D. All of the above

Q.2. When we simply want iteration through looping an array values we can use---------

A. current ( )                                                              B. foreach ( )
C. next ( ) function                                                       D. None of the above

Q.3. count ( ) function is identical to -------.

A. is_array ( ) function B. in_array ( ) function
C. sizeof ( )
D. None of the above

Q.4. Is_array ( ) function that takes a single argument of any type and returns a true value if -----.

A. Argument is an array
B. Argument is number type
C. Argument is character type
D. None of the above

Q.5.An array is a collection of------.

A. Strings
B. Indexed variables
C. Characters
D. Functions

Q.6. Which function take two arguments and returns true if element contained as a value of an array?

A. is_array ( ) function
B. in_array ( ) function
C. count ( ) function
D. isset ( ) function

Q.7. There are how many ways to create an array in PHP script

A. 1
B. 2
C. 3
D. 4

Q.8. For purpose of iteration Foreach is a ---------.

A. Function
B. language construct
C. Both A and B
D. loop

Q.9. User defined functions or may be built-in functions that's make an array via methods internal to PHP is called as ------.

A. Assignment arrays
B. Construct arrays
C. Functions returning arrays
D. All of the above

Q.10. Unlike vector arrays of C and C++ PHP arrays can store ----------.

A. Same type of data                                                                                B. Varied types of data
C. Small amount of data                                                                             D. All of the above

php programming language MCQ : Arrays- multidimensional arrays Link2

Php programming language MCQ : Arrays: Link2

Arrays MCQ

       Are you worried about the answers to PHP programming-Arrays-Identifying elements of an array, Storing data in arrays, Multidimensional arrays, Extracting multiple values, Converting between arrays and variables, Traversing arrays, Sorting questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Arrays MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. For finding nonempty elements in array we use--------

A. is_array ( ) function                                                              B. sizeof ( ) function
C. array_count ( ) function                                                       D. count ( ) function

Q.2. Pos ( ) function is an alias for---------

A. array_walk ( ) function                                                              B. each ( ) function
C. next ( ) function                                                       D. current ( ) function

Q.3. Indices of arrays can be either strings or numbers and they are denoted as-------.

A. $my_array {4}
B. $my_array [4]
C. $my_array| 4 |
D. None of the above

Q.4. To retrieve a value from an array we can use its -----.

A. Name
B. Location
C. Index
D. None of the above

Q.5. End ( ) function jumps pointer------.

A. To the last entry in the list
B. To the first entry in the list
C. To one step back
D. To one step forward

Q.6. To rewind pointer at beginning of list------ function is used.

A. rewind ( )
B. reset ( )
C. set ( )
D. None of the above

Q.7. Which function takes two arguments, an array to be traversed and name of a function to apply to each key/value pair?

A. array_walk ( ) function
B. each ( ) function
C. next ( ) function
D. end ( ) function

Q.8. Internal linked keys in an array can be retrievable by-----.

A. pointer ( ) function B. each ( ) function
C. key ( ) function
D. None of the above

Q.9. Current ( ) function is a -------array argument.

A. 2
B. 3
C. 1
D. None of the above

Q.10. Creating a new array from specification of its elements and associated keys, is known as----------.

 <?php \\
     \$fruits = array("apple", "orange", array ("pear", "mango"),
    "banana"); \\
    echo (count(\$fruits, 1));\\ 
?>

A. Direct assignment                                                                                B. Array ( ) construct
C. Specifying indices                                                                             D. All of the above

Php programming language MCQ : Arrays - Link1

Php programming language MCQ : Arrays: Link1

Arrays MCQ

       Are you worried about the answers to PHP programming-Arrays-Indexed Vs Associative arrays questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Arrays MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. Array values are keyed by ------ values (called indexed arrays) or using ------ values (called associative arrays).

A. Positive number, negative number                                                              B. Even number, string
C. String, Boolean                                                       D. Integer, string

Q.2. What will the following script output?

 <?php \\
     \$array = array(1,3,5,7,11,13,15); \\
     \$sum = 0; \\
         for(\$i=0;\:\$i<5\:;\$i++) \\
                 \{ \\
             \$sum+= \$array[\$array[\$i]];   \\
 \} \\
                 echo\:\: \$sum;\\ 
?>

A. 32                                                              B. 18
C. Null                                                       D. 0

Q.3. There are three different kind of arrays---------.

A. A) Numeric array, String array, Multidimensional array
B. Numeric array, Associative array, Dimensional array
C. Numeric array, Associative array, Multidimensional array
D. Const array, Associative array, Multidimensional array

Q.4. By default, the index of array in php starts from -----.

A. 0
B. 1
C. -1
D. 2

Q.5. Which of the following are correct ways of creating an array?
i) arr[0] = "totalmcq.com";
ii) $arr[] = array("totalmcq.com");
iii) $arr[0] = "totalmcq.com";
iv) $arr = array("totalmcq.com");

A. ii), iii) and iv)
B. ii) and iii)
C. Only i)
D. iii) and iv)

Q.6. Which function returns an array consisting of associative key/value pairs?

A. count()
B. array_count()
C. array_count_values()
D. count_values()

Q.7. Which function can be used to move the pointer to the previous array position?

A. last()
B. before()
C. previous()
D. prev()

Q.8. Which in-built function will add a value to the end of an array?

A. array_unshift()
B. into_array()
C. inend_array()
D. array_push()

Q.9. Which of the following PHP function will return true if a variable is an array or false if it is not an array?

A. this_array()
B. is_array()
C. do_array()
D. in_array()

Q.10. What will be the output of the following PHP code?

 <?php \\
     \$fruits = array("apple", "orange", array ("pear", "mango"),
    "banana"); \\
    echo (count(\$fruits, 1));\\ 
?>

A. 6                                                                                B. 5
C. 3                                                                             D. 4

php programming language multiple choice questions and answers :Introduction to web techniques :Link1

php programming language multiple choice questions and answers :Introduction to web techniques :Link1

PHP programming MCQ Answers

       Are you worried about the answers to PHP programming-web techniques questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the PHP programming MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. Who is the father of PHP?

A. Drek Kolkevi                                                              B. Willam Makepiece
C. Rasmus Lerdorf                                                        D. List Barely

Q.2. PHP is a.........

A. Tightly typed language                                            B. Server typed language
C. Loosely typed language                                           D. Client typed language

Q.3. PHP stands for --------

A. Hypertext preprocessor                                          B. Hypertext processor
C. HTML preprocessor                                                 D. HTML processor

Q.4. Which of the following is not a web server?

A. Apache tomcat                                                                  B. Jetty
C. Tornado code                                                                    D. BlueGriffon

Q.5. Which of the following is not a prepackaged server stack?

A. WAMP                                                                                  B. MAMP
C. XAMPP                                                                                 D. NAMP

Q.6. Software which allows user to view the webpage is called as--------

A. Operating System                                                              B. Internet Browser
C. Website                                                                               D. Interpreter

Q.7. PHP is an example of ___________ scripting language.

A. Server-side                                                                          B. Client-side
C. Browser-side                                                                       D. In-side

Q.8. Which of the following is not true?

A. PHP can be used to develop web applications.
B. PHP makes a website dynamic
C. PHP applications can not be compile
D. PHP can not be embedded into html.

Q.9. The hypertext transfer protocol(HTTP) uses the services of TCP on -------

A. Well-known port 80                                                  B. Well-known port 81
C. Well-known port 83                                                  D. Well-known port 82

Q.10. Which of the following must be installed on your computer so as to run PHP script?                      i)  PHP    ii) Apache    iii) IIS     iv) Adobe Dreamweaver

A. Only ii                                                                                B. i, ii and iii
C. ii and iii                                                                             D. All of the mentioned.

Q.11. Computer that requests the resources or data from other computer is called as----------computer.

A. Client                                                                               B. Server

Q.12. Which version of PHP include Try/catch Exception?

A. PHP 4                                                                               B. PHP 5
C. PHP 5 and later                                                              D. PHP 6

Q.13. Which of the following is/are a PHP code editor?
i. Notepad++    ii. NetBeans   iii. Eclipse PDT    iv. Adobe Dreamweaver

A. Only iv                                                                              B. Only iii
C. i, ii and iii                                                                         D. All of the above

Q.14.-----------is a technology that creates and handles dynamic documents.

A. CGI                                                                                     B. GIC
C. GCI                                                                                     D. none of the above

Q.15. In PHP language PEAR stands for-------

A. PHP Enhancement and Application Reduce
B. PHP Event and Application Repository
C. PHP Extension and Application Repository
D. None of the above