What will be the output of the following PHP code?
<?php
$fruits = array ("apple", "orange", "banana");
echo (next($fruits));
echo (next($fruits));
?>
What will be the output of the following PHP code?
<?php
$fruits = array ("apple", "orange", "banana");
echo (next($fruits));
echo (next($fruits));
?>
What function computes the difference of arrays?
What function computes the difference of arrays?
What elements will the following script output?
<?php
$array = array (true => 'a', 1 => 'b');
var_dump ($array);
?>
What elements will the following script output?
<?php
$array = array (true => 'a', 1 => 'b');
var_dump ($array);
?>
Which in-built function will add a value to the end of an array?
Which in-built function will add a value to the end of an array?
Which function can be used to move the pointer to the previous array position?
Which function can be used to move the pointer to the previous array position?
What will be the output of the following PHP code ?
<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>
What will be the output of the following PHP code ?
<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>
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 = array ("KA", "LA", "CA", "MA", "TA");
$array2 = array ("KA", "IA", "CA", "GA", "TA");
$inter = array_intersect ($array1, $array2);
print_r ($inter);
?>
Which array function checks if the specified key exists in the array?
Which array function checks if the specified key exists in the array?
Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?
Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?
What array will you get if you convert an object to an array?
What array will you get if you convert an object to an array?
What will be the output of the following PHP code?
<?php
$place = array("NYC", "LA", "Paris");
array_pop($place);
$place1 = array("Paris");
$place = array_merge($place, $place1);
print_r($place);
?>
What will be the output of the following PHP code?
<?php
$place = array("NYC", "LA", "Paris");
array_pop($place);
$place1 = array("Paris");
$place = array_merge($place, $place1);
print_r($place);
?>
What will be the output of the following PHP code?
<?php
$names = array("Sam", "Bob", "Jack");
echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".";
?>
What will be the output of the following PHP code?
<?php
$names = array("Sam", "Bob", "Jack");
echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".";
?>
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 = array ("mango", "apple", "peach", "pear");
$fruits = asort ($fruits);
printr ($fruits);
?>
Which function returns an array consisting of associative key/value pairs?
Which function returns an array consisting of associative key/value pairs?
What will be the output of the following php code?
<?php
$states = array("karnataka" => array( "population" => "11,35,000", "captial" => "Bangalore"),"Tamil Nadu" => array( "population" => "17,90,000","captial" => "Chennai") );
echo $states["karnataka"]["population"];
?>
What will be the output of the following php code?
<?php
$states = array("karnataka" => array( "population" => "11,35,000", "captial" => "Bangalore"),"Tamil Nadu" => array( "population" => "17,90,000","captial" => "Chennai") );
echo $states["karnataka"]["population"];
?>
What will be the output of the following PHP code?
<?php
$cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes", "Opel");
print_r(array_chunk($cars, 2));
?>
What will be the output of the following PHP code?
<?php
$cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes", "Opel");
print_r(array_chunk($cars, 2));
?>
What will be the output of the following PHP code?
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($fname, $age);
print_r($c);
?>
What will be the output of the following PHP code?
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($fname, $age);
print_r($c);
?>
What will the following script output?
What will the following script output?
What will be the output of the following PHP code?
<?php
$a = array("a"=>"red", "b"=>"green", "c"=>"blue");
echo array_shift($a);
print_r ($a);
?>
What will be the output of the following PHP code?
<?php
$a = array("a"=>"red", "b"=>"green", "c"=>"blue");
echo array_shift($a);
print_r ($a);
?>
What will be the output of the following PHP code?
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($age, $fname);
print_r($c);
?>
What will be the output of the following PHP code?
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($age, $fname);
print_r($c);
?>
What will be the output of the following PHP code ?
<?php
$array = array("red", "green");
array_push($array, "blue", "yellow");
print_r($array);
?>
What will be the output of the following PHP code ?
<?php
$array = array("red", "green");
array_push($array, "blue", "yellow");
print_r($array);
?>
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);
?>
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);
?>
What will be the output of the following PHP code?
<?php
$a1 = array("red", "green");
$a2 = array("blue", "yellow");
print_r(array_merge($a1, $a2));
?>
What will be the output of the following PHP code?
<?php
$a1 = array("red", "green");
$a2 = array("blue", "yellow");
print_r(array_merge($a1, $a2));
?>
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 = 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
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$a2 = array("e" => "red","f" => "green", "g" => "blue");
$result = array_intersect($a1, $a2);
print_r($result);
?>
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");
$result = array_intersect($a1, $a2);
print_r($result);
?>
What will be the output of the following PHP code?
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"), "banana");
echo (count($fruits, 1));
?>
What will be the output of the following PHP code?
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"), "banana");
echo (count($fruits, 1));
?>
What will be the output of the following PHP code ?
<?php
$a = array(12, 5, 2);
echo(array_product($a));
?>
What will be the output of the following PHP code ?
<?php
$a = array(12, 5, 2);
echo(array_product($a));
?>
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));
?>
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));
?>
What will be the output of the following PHP code ?
<?php
$people = array("Peter", "Susan", "Edmund", "Lucy");
echo pos($people);
?>
What will be the output of the following PHP code ?
<?php
$people = array("Peter", "Susan", "Edmund", "Lucy");
echo pos($people);
?>
Which function will return true if a variable is an array or false if it is not?
Which function will return true if a variable is an array or false if it is not?
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 = array ("4", "hello", 2);
echo (array_sum ($number));
?>
Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?
Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?
What will be the output of the following PHP code?
<?php
$a = array("red", "green", "blue");
array_pop($a);
print_r($a);
?>
What will be the output of the following PHP code?
<?php
$a = array("red", "green", "blue");
array_pop($a);
print_r($a);
?>
Which of the following are correct ways of creating an array?
1. state[0] = “karnataka”;
2. $state[] = array(“karnataka”);
3. $state[0] = “karnataka”;
4. $state = array(“karnataka”);
Which of the following are correct ways of creating an array?
1. state[0] = “karnataka”;
2. $state[] = array(“karnataka”);
3. $state[0] = “karnataka”;
4. $state = array(“karnataka”);
There are three different kind of arrays:
There are three different kind of arrays:
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 = 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
$age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21");
array_change_key_case($age, CASE_UPPER);
array_pop($age);
print_r($age);
?>
What will be the output of the following PHP code ?
<?php
$age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21");
array_change_key_case($age, CASE_UPPER);
array_pop($age);
print_r($age);
?>
What will be the output of the following PHP code?
<?php
$state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh");
echo (array_search ("Tamil Nadu", $state) );
?>
What will be the output of the following PHP code?
<?php
$state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh");
echo (array_search ("Tamil Nadu", $state) );
?>
What functions count elements in an array?
1. count
2. Sizeof
3. Array_Count
4. Count_array
What functions count elements in an array?
1. count
2. Sizeof
3. Array_Count
4. Count_array
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");
$result = array_diff($a1, $a2);
print_r($result);
?>
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");
$result = array_diff($a1, $a2);
print_r($result);
?>
What will be the output of the following PHP code ?
<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$result = array_flip($a1);
print_r($result);
?>
What will be the output of the following PHP code ?
<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$result = array_flip($a1);
print_r($result);
?>
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 = 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
$a1 = array("red", "green");
$a2 = array("blue", "yellow");
$a3 = array_merge($a1, $a2);
$a4 = array("a", "b", "c", "d");
$a = array_combine($a4, $a3);
print_r($a);
?>
What will be the output of the following PHP code?
<?php
$a1 = array("red", "green");
$a2 = array("blue", "yellow");
$a3 = array_merge($a1, $a2);
$a4 = array("a", "b", "c", "d");
$a = array_combine($a4, $a3);
print_r($a);
?>
What will be the output of the following PHP code?
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
print_r(array_change_key_case($age, CASE_UPPER));
?>
What will be the output of the following PHP code?
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
print_r(array_change_key_case($age, CASE_UPPER));
?>
What will be the output of the following PHP code?
<?php
$names = array("Sam", "Bob", "Jack");
echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".".$brother;
?>
What will be the output of the following PHP code?
<?php
$names = array("Sam", "Bob", "Jack");
echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".".$brother;
?>
What will be the output of the following PHP code?
<?php
$fruits = array ("mango", "apple", "pear", "peach");
$fruits = array_flip($fruits);
echo ($fruits[0]);
?>
What will be the output of the following PHP code?
<?php
$fruits = array ("mango", "apple", "pear", "peach");
$fruits = array_flip($fruits);
echo ($fruits[0]);
?>
What will be the output of the following PHP code ?
<?php
$number = range(0, 5);
print_r ($number);
?>
What will be the output of the following PHP code ?
<?php
$number = range(0, 5);
print_r ($number);
?>
What will be the output of the following PHP code?
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . ".";
?>
What will be the output of the following PHP code?
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . ".";
?>
PHP’s numerically indexed array begin with position ______.
PHP’s numerically indexed array begin with position ______.
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 = 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
$a = array("A", "Cat", "Dog", "A", "Dog");
print_r(array_count_values($a));
?>
What will be the output of the following PHP code?
<?php
$a = array("A", "Cat", "Dog", "A", "Dog");
print_r(array_count_values($a));
?>
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.
What will be the output of the following PHP code ?
<?php
$city_west = array("NYC", "London");
$city_east = array("Mumbai", "Beijing");
print_r(array_replace($city_west, $city_east));
?>
What will be the output of the following PHP code ?
<?php
$city_west = array("NYC", "London");
$city_east = array("Mumbai", "Beijing");
print_r(array_replace($city_west, $city_east));
?>