Alternatively, if you want to use a more functional style, you can append all strings that constitute an attribute assignment in the form of `key="value"` to an array and then `implode` them using a `" "`.