$color Array ('White', 'Green', 'Red', 'Blue', 'Black')
$color Array ('White', 'Green', 'Red', 'Blue', 'Black')
green
red
white
Create a PHP script which displays the capital and country name from the above
array $ceu.
Sample Output :
The capital of Netherlands is Amsterdam
The capital of Greece is Athens
The capital of Germany is Berlin
-------------------------
-------------------------
4. $x = array(1, 2, 3, 4, 5);
Delete an element from the above PHP array. After deleting the element, integer
keys must be normalized.
Sample Output :
array(5) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) }
array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(5) }
6. Write a PHP script that inserts a new item in an array in any position.
Expected Output :
Original array :
1 2 3 4 5
After inserting '$' the array is :
123$45
7. Write a PHP script to calculate and display average temperature, five lowest
and highest temperatures.
Recorded temperatures : 78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76,
73, 68, 62, 73, 72, 65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 73
Expected Output :
Average Temperature is : 70.6
List of seven lowest temperatures : 60, 62, 63, 63, 64,
List of seven highest temperatures : 76, 78, 79, 81, 85,
Write a PHP program to remove duplicate values from an array which contains
only strings or only integers
1 * 1 = 11 * 2 = 2 1 * 3 = 3 1 * 4 = 4 1 * 5 = 5
2 * 1 = 22 * 2 = 4 2 * 3 = 6 2 * 4 = 8 2 * 5 = 10
3 * 1 = 33 * 2 = 6 3 * 3 = 9 3 * 4 = 123 * 5 = 15
4 * 1 = 44 * 2 = 8 4 * 3 = 124 * 4 = 164 * 5 = 20
5 * 1 = 55 * 2 = 105 * 3 = 155 * 4 = 205 * 5 = 25
6 * 1 = 66 * 2 = 126 * 3 = 186 * 4 = 246 * 5 = 30
10. Write a PHP script using nested
for loop that creates a chess board as shown below.
Use table width="270px" and take 30px as cell height and width.