在PHP中从preg_replace中运行函数

在PHP中从preg_replace中运行函数,php,Php,我有一个网站,它使用PHP脚本从HTML文件加载一些数据并将其插入链接。到目前为止,它运行良好: $html = preg_replace('/(\d+):(\d+),/', '<a href="index.php?par1=$1&amp;par2=$2">$1&#58;$2</a>,', $html); 那么,如何让它运行呢?您可以使用它来执行任务 您可能需要稍微编辑一下函数的输出字符串。检查 $html = preg_replace('/(\d+):

我有一个网站,它使用PHP脚本从HTML文件加载一些数据并将其插入链接。到目前为止,它运行良好:

$html = preg_replace('/(\d+):(\d+),/', '<a href="index.php?par1=$1&amp;par2=$2">$1&#58;$2</a>,', $html);
那么,如何让它运行呢?

您可以使用它来执行任务

您可能需要稍微编辑一下函数的输出字符串。

检查
$html = preg_replace('/(\d+):(\d+),/', '<a href="index.php?par1=$1&amp;par2=$2" titel="loadTooltip($1, $2)">$1&#58;$2</a>,', $html);