<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$a2 = array("e" => "red","f" => "green", "g" => "blue");
a1, $a2);
print_r($result);
?>Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
53
Questions
2/3
Page
Pick an option on a question to see the right answer and solution.
<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$a2 = array("e" => "red","f" => "green", "g" => "blue");
a1, $a2);
print_r($result);
?>Select an option to see the answer and solution.
<?php
$a = array(12, 5, 2);
echo(array_product($a));
?>
Select an option to see the answer and solution.
<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>
Select an option to see the answer and solution.
<?php
$city_west = array("NYC", "London");
$city_east = array("Mumbai", "Beijing");
print_r(array_replace(city_east));
?>
Select an option to see the answer and solution.
<?php
$people = array("Peter", "Susan", "Edmund", "Lucy");
echo pos($people);
?>
Select an option to see the answer and solution.
<?php
$number = range(0, 5);
print_r ($number);
?>
Select an option to see the answer and solution.
<?php
$array = array("red", "green");
array_push($array, "blue", "yellow");
print_r($array);
?>
Select an option to see the answer and solution.
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
print_r(array_change_key_case($age, CASE_UPPER));
?>
Select an option to see the answer and solution.
<?php
$cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes", "Opel");
print_r(array_chunk($cars, 2));
?>
Select an option to see the answer and solution.
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
fname, $age);
print_r($c);
?>
Select an option to see the answer and solution.
<?php
$a = array("A", "Cat", "Dog", "A", "Dog");
print_r(array_count_values($a));
?>
Select an option to see the answer and solution.
<?php
$a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
$a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");
a1, $a2);
print_r($result);
?>
Select an option to see the answer and solution.
<?php
$a1 = array("red", "green");
$a2 = array("blue", "yellow");
print_r(array_merge(a2));
?>
Select an option to see the answer and solution.
<?php
$a = array("a"=>"red", "b"=>"green", "c"=>"blue");
echo array_shift($a);
print_r ($a);
?>
Select an option to see the answer and solution.
<?php
$a = array("red", "green", "blue");
array_pop($a);
print_r($a);
?>
Select an option to see the answer and solution.
<?php
$fruits = array ("mango", "apple", "pear", "peach");
fruits);
echo ($fruits[0]);
?>
Select an option to see the answer and solution.
<?php
$fruits = array ("mango", "apple", "peach", "pear");
fruits);
printr ($fruits);
?>
Select an option to see the answer and solution.
<?php
$arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg");
sort($arr);
print_r($arr);
?>
Select an option to see the answer and solution.
<?php
$face = array ("A", "J", "Q", "K");
$number = array ("2","3","4", "5", "6", "7", "8", "9", "10");
face, $number);
print_r ($cards);
?>
Select an option to see the answer and solution.
<?php
$fruits = array ("apple", "mango", "peach", "pear", "orange");
fruits, 2);
print_r ($subset);
?>
Select an option to see the answer and solution.