PHP Taskbook Level 9.6

Задание 1

Generate an HTML table colored like a checkerboard.

Задание 2

The following array is given:

php$arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];

From the given array, dynamically create an HTML table of 5 columns.

Задание 3

Given an arbitrary two-dimensional array:

php[
  [11, 12, 13, 14, 15],
  [21, 22, 23, 24, 25],
  [31, 32, 33, 34, 35],
  [41, 42, 43, 44, 45],
  [51, 52, 53, 54, 55],
]

Zero out the elements below the main diagonal:

php[
  [11, 12, 13, 14, 15],
  [ 0, 22, 23, 24, 25],
  [ 0,  0, 33, 34, 35],
  [ 0,  0,  0, 44, 45],
  [ 0,  0,  0,  0, 55],
]
Задание 4

Given some URL:

php$url = 'http://test.com/dir1/dir2/dir3/page.html';

Given variables:

php$num = 2;
$val = 'eee'

Replace the folder number $num in the URL with the value $val:

php'http://test.com/dir1/eee/dir3/page.html';