a) Polymorphism b) Inheritance c) Encapsulation d) Abstraction Answer: c Explanation: In object-oriented PHP encapsulation is ...
View Question
What will be the output of the following PHP code?
<?php
$array1 = array (“KA”, “LA”, “CA”, “MA”, “TA”);
$array2 = array (“KA”, “IA”, “CA”, “GA”, “TA”);
$inter = array_intersect ($array1, $array2);
print_r ($inter);
?>
What will be the output of the following PHP code? <?php $array1 ...
View Question
What will be the output of the following PHP code?
<?php
$number = array (“4”, “hello”, 2);
echo (array_sum ($number));
?>
What will be the output of the following PHP code? <?php $number ...
View Question
What will be the output of the following PHP code?
<?php
$fruits = array (“apple”, “mango”, “peach”, “pear”, “orange”);
$subset = array_splice ($fruits, 2);
print_r ($fruits);
?>
What will be the output of the following PHP code? <?php $fruits ...
View Question
What will be the output of the following PHP code?
<?php
$fruits = array (“apple”, “mango”, “peach”, “pear”, “orange”);
$subset = array_slice ($fruits, 2);
print_r ($subset);
?>
What will be the output of the following PHP code? <?php $fruits ...
View Question
What will be the output of the following PHP code?
<?php
$face = array (“A”, “J”, “Q”, “K”);
$number = array (“2″,”3″,”4”, “5”, “6”, “7”, “8”, “9”, “10”);
$cards = array_merge ($face, $number);
print_r ($cards);
?>
What will be the output of the following PHP code? <?php $face ...
View QuestionWhich function should we use to sort the array in natural order?
a) dsort() b) casesort() c) natcasesort() d) naturalsort() Answer: c Explanation: The function natcasesort() in PHP sorts an array ...
View Question
What will be the output of the following PHP code?
<?php
$arr = array (“picture1.JPG”, “picture2.jpg”, “Picture10.jpg”, “picture20.jpg”);
sort($arr);
print_r($arr);
?>
What will be the output of the following PHP code? <?php $arr ...
View Question
What will be the output of the following PHP code?
<?php
$fruits = array (“mango”, “apple”, “peach”, “pear”);
$fruits = asort ($fruits);
printr ($fruits);
?>
What will be the output of the following PHP code? <?php $fruits ...
View QuestionWhich of the functions is used to sort an array in descending order?
a) sort() b) asort() c) rsort() d) dsort() Answer: c Explanation: The function sort() will sort ...
View Question