PHP Matrix data structure