function replace_phiz($content){
preg_match_all('/[.*?]/is', $content, $arr);
if ($arr[0]) {
$phiz = F('phiz','','./Data/');
foreach ($arr[0] as $v) {
foreach ($phiz as $k => $value) {
if ($v == '['.$value.']') {
$content = str_replace($v, '<img src="'.__ROOT__.'/Public/Images/phiz/'.$k.'.gif"/>', $content);
}
}
continue;
}
}
return $content
}
在tp中使用自定义函数 使用str_replace时,并不能正常替换。想大神指点一下这是什么原因?