/***
* 根本平台类型获取文件名
*/
function showGetFileName(
$type,
$url){
#判断平台类型
if(
$type=='android'||
$type=='ios'
){
#拼接类型
$url=
$url.'/'.
$type.'/assets'
;
#读取该文件 得到所有文件的对象
$handle=
opendir(
$url."."
);
#定义数组接受文件名
$array_file =
array();
#循环读取
while (
false !== (
$file =
readdir(
$handle)))
{
if (
$file != "." &&
$file != ".."
) {
$array_file[] =
$file;
//输出文件名
}
}
#关闭
closedir(
$handle);
#返回数组
return $array_file;
}
}
转载于:https://www.cnblogs.com/hgj123/p/4495696.html
转载请注明原文地址: https://mac.8miu.com/read-9988.html