function printTargetsAndXrdUrls($results)
{
    foreach ($results as $result) {
        echo "&nbsp;&nbsp;XRD: " . htmlspecialchars($result["xrd"]) . "<br/>";
        printTarget($result["target"]);
    }
}
<?php 
if ($cmd == "reg") {
    // Going to register the provider defined by a specific XRD
    // Look it up, get info
    $disc = new OExchangeDiscoverer();
    $target = $disc->getTargetInfoFromXrd($xrdUrl);
    if (isset($target)) {
        ?>
			<h2>OExchange Target Found</h2>
			<p>
				We found an OExchange Target descriptor at <?php 
        echo $xrdUrl;
        ?>
:<br/>
			<?php 
        printTarget($target);
        ?>
			</p>
				
			<?php 
        // Whats the right intent?
        $action = "http://webintents.org/share";
        $type = "text/uri-list";
        $disposition = "window";
        $title = $target->prompt . " (via " . $target->name . ")";
        $href = "proxy.php?offerpoint=" . urlencode($target->endpoint);
        // Intent markup...
        $intentTag = '<intent';
        $intentTag .= ' action="' . $action . '"';
        $intentTag .= ' type="' . $type . '"';
        $intentTag .= ' href="' . $href . '"';