My homework from PHP class