HP Previous Years Solved Sample Placement Papers
- As compared to associative arrays, vector arrays are much
a) Faster
b) Slower
c) Stable
d) None of them
Answer: a) Faster - Which function returns an array consisting of associative key/value pairs?
a) count()
b) array_count()
c) array_count_values()
d) count_values()
Answer: c) array_count_values() - The updated MySQL extension released with PHP 5 is typically referred to as..
a) MySQL
b) mysql
c) mysqli
d) mysqly
Answer: c) mysqli - Which one of the following statements is used to create a table?
a) CREATE TABLE table_name (column_name column_type);
b) CREATE table_name (column_type column_name);
c) CREATE table_name (column_name column_type);
d) CREATE TABLE table_name (column_type column_name);
Answer: a) CREATE TABLE table_name (column_name column_type); - Which one of the following statements can be used to select the database?
a) $mysqli=select_db('databasename');
b) mysqli=select_db('databasename');
c) mysqli->select_db('databasename');
d) $mysqli->select_db('databasename');
Answer: d) $mysqli->select_db('databasename'); - Which of the methods are used to manage result sets using both associative and indexed arrays?
a) get_array() and get_row()
b) get_array() and get_column()
c) fetch_array() and fetch_row()
d) fetch_array() and fetch_column()
Answer: c) fetch_array() and fetch_row() - Which two predefined variables are used to retrieve information from forms?
a) $GET & $SET
b) $_GET & $_SET
c) $__GET & $__SET
d) GET & SET
Answer: b) $_GET & $_SET - When you use the $_GET variable to collect data, the data is visible to..
a) none
b) only you
c) everyone
d) selected few
Answer: c) everyone - When you use the $_POST variable to collect data, the data is visible to..
a) none
b) only you
c) everyone
d) selected few
Answer: b) only you - Which function is used to check whether a variable is an array or not?
a) on_array()
b) is_array()
c) the_array()
d) None
Answer: b) is_array() - Which function adds a new element at the end of an array?
a) push()
b) pop()
c) stack()
d) None
Answer: a) push() - Which function returns the last element of an array?
a) push()
b) pop()
c) stack()
d) None
Answer: b) pop()