Two dimension number matrix implementation in PHP