php trial for format 4 with loop