the php version of problem 4
the other components of problem 4