Create a matrix like strukture with looping concept PHP