Hi all,

How can i modify the attribute of a node using php?

Eg: <node width='50'>
<detail>test</detail>
</node>

i want to change the attribute width to 100 using the php code?

Haw can i fix this?
Thanx in advance

You can use DOM (XML content represented in a tree) in PHP. Get a DOM node on the tag that contains the attribute, get the attributes map of that node and remove the pair that has "width" as key.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.