I'm trying to do somwthing like this (where $doc is a DOMDocument)
$link_found = $doc->getElementsByTagName('a');
foreach ($link_found as $idx => $link) {
$link->setAttribute('href', "/test.php?t=1&q=2" ) ;
}
All is working, but in the href now I got
"/test.php?t=1&q=2"
I need the literal &
, not encoded in &
I need
"/test.php?t=1&q=2"
Like a common query string