I don't like your tactic here. When all attributes will be asigned there will be a space before `>`. That's not beautiful. I suggest you remove the space after `"` on 145, and add a space before `echo $key` on like 148. That way you can remove the space on line 151 also.

This is just a suggestion, you can ommit that if you wish