"); $endstr = strpos($instr, ""); $lentag = strlen($tag); if ($startstr && $endstr) { $startstr = $startstr + $lentag + 2; $outstr = substr($instr, $startstr, $endstr - $startstr); } else { $outstr = FALSE; } return $outstr; } // odlink - returns a link to a given OpenDocument file // $odfile The file we wish to link to // $linkclass The CSS class for the link tag function odlink($odfile, $linkclass) { $metastr = shell_exec("unzip -p " . $odfile . " meta.xml"); $linktitle = 'Properties: '; if (!$odtitle = gettag($metastr, "dc:title")) { $odtitle = "Untitled"; } if ($odcreator = gettag($metastr, "dc:creator")) { $linktitle = $linktitle . 'Created by ' . $odcreator . '; '; } if ($oddate = gettag($metastr, "dc:date")) { $linktitle = $linktitle . 'Date ' . $oddate . '; '; } $linktitle = substr($linktitle, 0, (strlen($linktitle) - 3)); $linkstr = '' . $odtitle . '' . "\n"; return $linkstr; } // In your script, include this file, then call odlink to insert a hyperlink to an OpenDocument file. // include "od.php"; // echo odlink("example.odt", "linkstyle"); ?>