<?php
$html = <<<DATA
<html>
 <head><title>Nice page</title></head>
<body>
    Hello World
 <a href=http://c...content-available-to-author-only...n.com title="a link">
                this is a link
 </a>
<br />
<a href=http://w...content-available-to-author-only...n.com> Here too <img src=wrong.image title="and again">
    <span>Even that<div title="same">all the same</div></span>
</a>
</body>
</html>
DATA;

$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

$xpath = new DOMXPath($dom);
$titles = $xpath->query('//a[@title]');

foreach($titles as $title) { 
   $title->setAttribute("title", mb_strtoupper($title->getAttribute("title"), 'UTF-8'));
}

echo $dom->saveHTML();