my function for php

done with lecturer