Home >Backend Development >PHP Tutorial >请教一下thinkphp模板使用函数的有关问题

请教一下thinkphp模板使用函数的有关问题

WBOY
WBOYOriginal
2016-06-13 10:07:20882browse

请问一下thinkphp模板使用函数的问题
我想把ip最后一位替换成*我用的如下方式
{$vo.ip|preg_replace='/((?:\d+\.){3})\d+/','\\1*',###}
提示错误
Parse error: syntax error, unexpected ':' in C:\wamp\www\guestbook\guestbook\Runtime\Cache\Guestbook\b5add68846b03533035d53dc5ca1074b.php on line 34望高手解答,还有就是我会输出之前替换不用告诉我输出之前怎样替换,我就是想知道模板输出时是怎样替换的,谢谢。
 


------解决方案--------------------
$str=preg_replace("/\->\w+$/", "", $_GET['name']);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn