Practice on PHP Functions

Задание 1

Make a function that will accept a number as a parameter and return an array of its divisors.

Задание 2

Make a function that will accept two numbers as parameters and return an array of their common divisors.

Задание 3

Make a function that will accept a number as a parameter and return the sum of its digits.

Задание 4

Make a function that will return the current day of the week as a word.

Задание 5

Make a function that will get a date as a parameter, and return the day of the week as a word, corresponding to that date.

Задание 6

Make a function that will accept seconds as a parameter, and return the number of days, corresponding to those seconds.

Задание 7

Make a function that will get a year as a parameter and check, whether it is a leap year or not.

Задание 8

Make a function that will accept a number as a parameter and check, whether it is prime or not.