PHP Taskbook Level 10.3

Задание 1

Given an array of six digits, check if you can assemble a winning ticket from these digits.

Задание 2

Write a code that will generate a password of a given size. The password must contain a lowercase and uppercase letter, a number, and some special symbol.

Задание 3

Given two numbers, display the process of dividing these numbers in a column, as in school.

Задание 4

Given a string containing two numbers and a mathematical operation between them:

php'10 + 20'

Write code that will calculate the result of the written mathematical operation.

Задание 5

Given an arbitrary two-dimensional array:

php[
  [11, 12, 13],
  [21, 22, 23],
  [31, 32, 33],
]

Write some code that will add another row and another column to it, filled with random values:

php[
  [11, 12, 13, 14],
  [21, 22, 23, 24],
  [31, 32, 33, 34],
  [41, 42, 43, 44],
]
Задание 6

Let the database store a table of the following type:

orders table
id name date price amount
1 prod1 2020-12-31 100 3

Using the data in this table, get an array containing the sum of orders by year and month:

php[
  '2020' => [
    '01' => '...',
    '02' => '...',
  ],
  '2021' => [
    '11' => '...',
    '12' => '...',
  ],
];