更新时间:2023-02-20 08:46:32
看起来不错,尽管您可以保存temp变量:
Looks fine, although you can save the temp variables:
$newtext = explode(":", $line,1);
echo "<font color=red>$newtext[0]</font>:$newtext[1]";
这可能会更快,也可能不会,您必须进行测试:
This might be faster or might not, you'd have to test:
echo '<font color=red>' . substr_replace($line, '</font>', strpos($line, ':') , 0);