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

14 lines
556 B
PHP
Raw Normal View History

2011-08-02 19:57:57 +02:00
<?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;
}
?>