I'm new into PHO DOM Parser. I have a string like this :
$coded_string = "Hello, my name is <a href="link1">Marco</a> and I'd like to <strong>change</strong> all <a href="link2">links</a> with a custom text";
and I'd like to change all text in the links (in the example, Marco and links) with a custom string, let say hello.
How can I do it on PHP? At the moment I only initilized the XDOM/XPATH parser as :
$dom_document = new DOMDocument();
$dom_document->loadHTML($coded_string);
$dom_xpath = new DOMXpath($dom_document);