Skip to content
Advertisement

Category: Questions

Is there a way to get all of a DOMElement’s attributes?

I’m reading some XML with PHP and currently using the DOMDocument class to do so. I need a way to grab the names and values of a tag’s (instance of DOMElement) attributes, without knowing beforehand what any of them are. The documentation doesn’t seem to offer anything like this. I know that I can get an attribute’s value if I

How do I set the selected item in a drop down box

Is there any way to set the selected item in a drop down box using the following ‘type’ code?