Miscellany
public text v1 · immutable<?
$text = "abcdefghtasdf [3] abcd";
$array = array("jedna","dva","tri");
$pattern = '/\[(\d+)\]/e';
$replacement = '<a href="index.php?action=$1">$array[\\1]</a>';
echo preg_replace($pattern, $replacement, $text);
?>