联系官方销售客服
1835022288
028-61286886
请教一个问题:模板loop里如何调用自己写的函数
<?php function getDateFromRange($startdate,$enddate){ $stimestamp = strtotime($startdate); $etimestamp = strtotime($enddate); $days = ($etimestamp-$stimestamp)/86400+1; $date = array(); for($i = 0; $i < $days; $i++){ $date[] = date('Y-m-d', $stimestamp+(86400*$i)); } return $date; } ?> {loop $datestart $v} 开始日期:{$v[1]} 结束日期:{$v[2]} {php $datestartend = array();$datestartend = getDateFromRange({$v[1]},{$v[2]});} {/loop}
这样写显示报错