metanohi-misc-subsites/subsites/pictures/get_info.php

14 lines
556 B
PHP
Executable File

<?php
function get_info($img) {
$txt = @file_get_contents("info/$img.info");
if (!$txt || $txt == '')
return 'No information available.';
//return preg_replace(array('/<(.*)>/', '/[(.*)]/'), array("&lt;<a href='$1'>$1</a>&gt;", "[<a href='$1'>$1</a>]"), $txt);
//$txt = preg_replace('/<(.*)>/', "&lt;<a href='$1'>$1</a>&gt;", $txt);
//$txt = preg_replace('/\[(.*)\]/', "[<a href='$1'>$1</a>]", $txt);
return preg_replace(array('/<(.*)>/', '/\[([^]]*)\]/'), array("&lt;<a href='$1'>$1</a>&gt;", "[<a href='$1'>$1</a>]"), $txt);
return $txt;
}
?>