0
我想只找到那些来自某个目录的文件,它等于数据库中的数组名称。 总之,我有这样的代码findFiles by where file name = some name?
$array = array(
'img1.jpg','img2.jpg'
);
$array = serialize($array);
$model->file=$array;
$model->save();
// saved all the names in database and then:
$files = unserialize($model->file);
// and now, i have an array with the names:
Array
(
[0] => img1.jpg
[1] => img2.jpg
[2] => img3.jpg
)
$path = 'files';
$data = CFileHelper::findFiles($path); // an array with files
,并在这里,我想要做的事等;从$数据或在$数据文件名称= $文件的文件名
好吧,我心底尝试。谢谢你的回答。 – Nick 2014-09-12 10:54:55