/ Published in: PHP
Convenience function to set a SimpleXMLElement's attributes quickly.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function set_simplexml_attributes($element, $attributes) { foreach($attributes as $key => $value) { $element->addAttribute($key, $value); } } // ex: "id" => "1", "enabled" => "true", "iconUrl" => $this->thinger, "tooltip" => "popups/study.swf" ));