<?php $cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes", "Opel"); print_r(array_chunk($cars, 2)); ?>
<?php $fname = array("Peter", "Ben", "Joe"); $age = array("35", "37", "43"); $c = array_combine($fname, $age); print_r($c); ?>
<?php $a = array("a"=>"red", "b"=>"green", "c"=>"blue"); echo array_shift($a); print_r ($a); ?>
<?php $arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg"); sort($arr); print_r($arr); ?>
<?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); ?>
<?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); ?>
<?php $a = array(12, 5, 2); echo(array_product($a)); ?>
<?php $a = array("red", "green", "blue"); array_pop($a); print_r($a); ?>
<?php $fruits = array ("apple", "mango", "peach", "pear", "orange"); $subset = array_slice ($fruits, 2); print_r ($subset); ?>
<?php $names = array("Sam", "Bob", "Jack"); echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . "."; ?>
<?php $names = array("Sam", "Bob", "Jack"); echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".".$brother; ?>
<?php $a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti"); echo array_search("Audi", $a); ?>
<?php $city_west = array("NYC", "London"); $city_east = array("Mumbai", "Beijing"); print_r(array_replace($city_west, $city_east)); ?>
<?php $cars = array("Volvo", "BMW", "Toyota"); echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . "."; ?>
<?php $fname = array("Peter", "Ben", "Joe"); $age = array("35", "37", "43"); $c = array_combine($age, $fname); print_r($c); ?>
<?php $place = array("NYC", "LA", "Paris"); array_pop($place); $place1 = array("Paris"); $place = array_merge($place, $place1); print_r($place); ?>
<?php $age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21"); array_change_key_case($age, CASE_UPPER); array_pop($age); print_r($age); ?>
<?php $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow"); $result = array_flip($a1); print_r($result); ?>
<?php $people = array("Peter", "Susan", "Edmund", "Lucy"); echo pos($people); ?>
Please disable the adBlock and continue. Thank you.