不确定这个,希望你能帮助我解决这个问题......
这是我的代码
Loader::library('file/types');
$ih = Loader::helper('image');
$names = explode("||",$this->tName);
$urls = explode("||",$this->tUrl);
$fIDs = explode("||",$this->fID);
Loader::model('file');
$i = Loader::helper('image');
$v = array();
$cc = 0;
foreach ($names as $k=>$n){
if (intval($fIDs[$k]) > 0 ) :
$img = $test = File::getByID($fIDs[$k]);
$fv = $img->getExtension();
$ft = FileTypeList::getType($fv);
$img = $ft->type == 1 ? $img : false;
else :
$img = false;
endif;
$v[$cc]['name'] = $n;
$v[$cc]['url'] = $urls;
$v[$cc]['src'] = $img ? $ih->getThumbnail($img,100,100)->src : false;
$cc ++;
}
return $v;
我遇到的问题是从这段代码中的 $urls 获取数组值。(倒数第五个)
foreach ($names as $k=>$n){
if (intval($fIDs[$k]) > 0 ) :
$img = $test = File::getByID($fIDs[$k]);
$fv = $img->getExtension();
$ft = FileTypeList::getType($fv);
$img = $ft->type == 1 ? $img : false;
else :
$img = false;
endif;
$v[$cc]['name'] = $n;
$v[$cc]['url'] = $urls;
$v[$cc]['src'] = $img ? $ih->getThumbnail($img,100,100)->src : false;
$cc ++;
}
return $v;
感谢你的帮助。欣赏它。