DomQuery::setAttr();
Adds an attribute & value set to all matched elements from the previous XPath expression.
$DomQuery = new DomQuery;
$DomQuery->load($xml)->path('//foo')->setAttr('id', 7);
Definition:
public function setAttr($key, $value)
Parameters:
| Name | Type | Description |
|---|---|---|
| $key | String | The name of the attribute. |
| $value | String | The value of the attribute. |