How should I parse the PHP given in a matrix?