How to setAttribute of DOMDocument element with special characters?
https://stackoverflow.com/questions/37174897/how-to-setattribute-of-domdocument-element-with-special-characters
<p>Hello: <img src="hello/foo.png" /></p>$link = $a->getAttribute('src');
$pat = '#(\w+\.\w+)+(?!.*(\w+)(\.\w+)+)#';
$matches = [];
preg_match($pat, $link, $matches);
$newStr = "{{ storage_path('app/' . " . $matches[0] . ") }}";
$a->setAttribute('src', $newStr);1 Answer
Last updated
